-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindow_object.html
More file actions
48 lines (40 loc) · 1.49 KB
/
window_object.html
File metadata and controls
48 lines (40 loc) · 1.49 KB
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
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html>
<body>
<script>
sessionStorage.setItem("Name", "Window Object")
function details(){
document.getElementById("a1").innerHTML = "OuterHeight " + window.outerHeight
document.getElementById("a2").innerHTML = "InnerHeight " + window.innerHeight
document.getElementById("a4").innerHTML = "Session Storage " + window.sessionStorage.getItem('Name')
}
function clo(){
window.close()
}
function interval(){
setInterval(change, 1000)
}
function change(){
if (document.getElementById("a3").innerHTML == 'Window')
document.getElementById("a3").innerHTML = 'Object'
else
document.getElementById("a3").innerHTML = 'Window'
}
function timeout(){
setTimeout(() => {
window.close()
}, 20000);
}
interval()
timeout()
</script>
<div align="center">
<h3 id=a3>Window</h3>
<h4 id=a1>OuterHeight</h4>
<h4 id=a2>InnerHeight</h4>
<h4 id=a4>Session Storage</h4>
<button onclick="details()">Get details</button>
<button onclick="clo()">Close</button>
</div>
</body>
</html>