mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:07:44 +00:00
Base: Add simple setInterval() test
This commit is contained in:
parent
4e657c370c
commit
65d94a1e74
2 changed files with 24 additions and 0 deletions
23
Base/home/anon/www/set-interval.html
Normal file
23
Base/home/anon/www/set-interval.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>setInterval() test</title>
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
var output = document.getElementById("output");
|
||||
var counter = 0;
|
||||
function updateOutput () {
|
||||
output.innerHTML = `setInterval() was called ${counter} times!`;
|
||||
}
|
||||
updateOutput();
|
||||
setInterval(function () {
|
||||
counter++;
|
||||
updateOutput();
|
||||
}, 1000);
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="output"></div>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue