about summary refs log tree commit diff
path: root/usth/ICT3.2/prac/3/4.html
diff options
context:
space:
mode:
Diffstat (limited to 'usth/ICT3.2/prac/3/4.html')
-rw-r--r--usth/ICT3.2/prac/3/4.html23
1 files changed, 23 insertions, 0 deletions
diff --git a/usth/ICT3.2/prac/3/4.html b/usth/ICT3.2/prac/3/4.html
new file mode 100644
index 0000000..0444d1e
--- /dev/null
+++ b/usth/ICT3.2/prac/3/4.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<script src='https://code.jquery.com/jquery-3.5.1.min.js'
+        integrity='sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0='
+        crossorigin='anonymous'></script>
+
+<body>
+  <h1>Heading1</h1>
+  <h2>Heading2</h2>
+  <p>Paragraph</p>
+  <button>Button</button>
+  <div id="log"></div>
+  <script>
+    let previous;
+    $('button').click(function (event) {
+        current = Date.now();
+        if (previous !== undefined)
+            $('#log').html(`${current-previous} ms`);
+        previous = current;
+    })
+  </script>
+</body>
+</html>