Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ff97f2f

Browse files
cleartimeout and setout in js
1 parent f22e174 commit ff97f2f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎Basic Introduction/index.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,19 @@
1111

1212
<script>
1313

14-
setTimeout(myFunction , 5000);
14+
lettimeout=setTimeout(myFunction , 5000);
1515

1616
function myFunction(){
1717
alert('This is the real method of settimeout function ')
1818
}
19+
20+
let ans = prompt('Enter your age');
21+
22+
if(ans < 18)
23+
{
24+
clearTimeout(timeout);
25+
}
26+
1927
</script>
2028
</body>
2129
</html>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /