Skip to content

Commit 06a22e6

Browse files
committed
Added Js file on my repo
Clearing SetTimeout with JavaScript.
1 parent 8f6068a commit 06a22e6

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# Clearing SetTimeout with JavaScript
2-
An awe-inspiring software for proactve purposes in an orgainzation
2+
An awe-inspiring software for proactive security purposes in an orgainzation.
3+
4+

time.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
let output = document.querySelector('div')
2+
let textbox = document.querySelector('input')
3+
let wordsToType ="hello world this is typing";
4+
let timeDispalyer = document.querySelector('[data-time-display]')
5+
6+
let time = 200;
7+
8+
function timer (){
9+
time --
10+
11+
timeDispalyer.innerHTML = time
12+
// console.log(time);
13+
}
14+
15+
let timing = setInterval(timer, 1000);
16+
17+
setTimeout(() => {
18+
19+
clearTimeout(timing)
20+
}, 200*1000);
21+
22+
textbox.oninput= (e)=>{
23+
for (let i = 0; i < wordsToType.length; i++) {
24+
const element = wordsToType[i];
25+
if (element == e.target.value[i]) {
26+
console.log(element);
27+
}
28+
29+
}
30+
}

0 commit comments

Comments
 (0)