-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathiframe1.html
More file actions
32 lines (31 loc) · 715 Bytes
/
iframe1.html
File metadata and controls
32 lines (31 loc) · 715 Bytes
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
<!-- iframe1.html -->
<html>
<head>
<style>
body {
background:yellowgreen;
}
#myDIV{
background:yellow;
border:3px solid brown;
padding:50px;
margin:10px 0;
}
</style>
</head>
<body>
<h1>Iframe content</h1>
<button type="button" id="toggleDivButton" onclick="toggleDiv()">Toggle div</button>
<div id="myDIV" style="display:none;">Hidden content</div>
<script>
function toggleDiv() {
var x = document.getElementById("myDIV");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
</script>
</body>
</html>