Note
Random Number
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Math</h2>
<p>Math.floor() used with Math.random() * 101 returns a random integer between 0 and 100
(both included):</p>
<p id="demo"></p>
<script>
function pollDOM () {
var x ="", i;
for (i=1; i<=20; i++) {
document.getElementById("demo").innerHTML = Math.floor(Math.random() * 101);
setTimeout(pollDOM, 1000);
}
}
pollDOM ()
</script>
</body>
</html>Random Integer
Random Float
Clear Interval
Wait
Get Value of each Element in the form.
Start & Stop Counter
Set & Clear Interval
Interval
Last updated
Was this helpful?