I'm trying to create a webpage the looks like a health monitor and I need to create a random number generator that will act as the heart monitor. Here is what I have:
<?php
function functionName()
{
return rand(5, 15);
}
?>
<html>
<body>
<?php
$i = 0;
while ($i <= 10)
{
echo functionName();
echo "</br>";
$i++;
}
?>
</body>
</html>
setInterval(function() {
var i = Math.floor(Math.random() * (15 - 5 + 1)) + 5;
document.getElementById("random").innerHTML = i;
}, 1000);
<span id="random"></span>
this maybe? using Math.random(); and setInterval()