-
Notifications
You must be signed in to change notification settings - Fork 0
/
delay.html
37 lines (37 loc) · 912 Bytes
/
delay.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<html>
<head>
<script>
function ti() {
window.setTimeout(function() {
document.title = Math.random().toString(36).substr(2, 5);
}, 2000);
}
function al() {
window.setTimeout(function() {
window.alert("alert");
}, 2000);
}
function co() {
window.setTimeout(function() {
window.confirm("confirm");
}, 2000);
}
function pr() {
window.setTimeout(function() {
window.prompt("prompt");
}, 2000);
}
function print() {
window.setTimeout(function() {
window.print();
}, 2000);
}
</script>
</head>
<body>
<p><button onclick="ti()">Change the title after a delay</button></p>
<p><button onclick="al()">Fire an alert dialog after a delay</button></p>
<p><button onclick="co()">Fire a confirm dialog after a delay</button></p>
<p><button onclick="pr()">Fire a prompt dialog after a delay</button></p>
<p><button onclick="print()">Fire a print dialog after a delay</button></p>
</html>