about summary refs log tree commit diff
path: root/usth/ICT3.2/prac/3/4-vanilla.html
blob: 9ea396fcf4ab8fb6520170e3e7f9715ac2389460 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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>