Skip to content

Commit 34b0390

Browse files
committed
New: Single thred simple exampe.
1 parent 40be4b6 commit 34b0390

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

dom/thred.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<body>
4+
<div id="result"></div>
5+
<button onclick="startHandler()">Start Calculations</button>
6+
<button onclick="clickHandler()">Click Me!</button>
7+
<script>
8+
let div = document.getElementById('result');
9+
const startHandler = () => {
10+
let result = 0;
11+
for(var i = 0 ; i< 10000000000; i++) {
12+
result+=i
13+
}
14+
div.innerText += result;
15+
}
16+
const clickHandler = () => {
17+
div.innerText += ' Button clicked';
18+
}
19+
</script>
20+
</body>
21+
</html>
22+

0 commit comments

Comments
 (0)