mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-24 23:23:58 +00:00
Base: Add simple setInterval() test
This commit is contained in:
parent
4e657c370c
commit
65d94a1e74
Notes:
sideshowbarker
2024-07-19 06:16:59 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/65d94a1e742 Pull-request: https://github.com/SerenityOS/serenity/pull/2319
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>
|
|
@ -28,6 +28,7 @@ span#ua {
|
|||
<p>Your user agent is: <b><span id="ua"></span></b></p>
|
||||
<p>Some small test pages:</p>
|
||||
<ul>
|
||||
<li><a href="set-interval.html">setInterval() test</a></li>
|
||||
<li><a href="html-escape-test.html">html character escape test</a></li>
|
||||
<li><a href="location.html">window.location property</a></li>
|
||||
<li><a href="percent-css.html">CSS percentage values</a></li>
|
||||
|
|
Loading…
Reference in a new issue