diff options
Diffstat (limited to 'usth/ICT3.2/prac/3/4-vanilla.html')
-rw-r--r-- | usth/ICT3.2/prac/3/4-vanilla.html | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/usth/ICT3.2/prac/3/4-vanilla.html b/usth/ICT3.2/prac/3/4-vanilla.html new file mode 100644 index 0000000..9ea396f --- /dev/null +++ b/usth/ICT3.2/prac/3/4-vanilla.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<script> +let previous; +function measure() { + current = Date.now(); + if (previous !== undefined) + document.getElementById('log').innerHTML = `${current-previous} ms`; + previous = current; +} +</script> + +<body> + <h1>Heading1</h1> + <h2>Heading2</h2> + <p>Paragraph</p> + <button onclick='measure()'>Button</button> + <div id="log"></div> +</body> +</html> |