2 function toggleDisplay(element
, button
)
4 if (element
.style
.display
== "none")
5 element
.style
.display
= "";
7 element
.style
.display
= "none";
10 function toggleVisibility(element
, button
)
12 if (element
.style
.visibility
== "hidden")
13 element
.style
.visibility
= "";
15 element
.style
.visibility
= "hidden";
20 Play with the display and visibility toggles. Make sure that turning an inner element visible does not show it if it has a hidden or
21 non-displaying ancestor, and that making an ancestor visible and displaying shows only its descendants the are visible and displaying.
26 <input type=
"checkbox" checked=
"true" onclick=
"toggleDisplay(document.getElementById('middle'))"> Outer frame display
29 <input type=
"checkbox" checked=
"true" onclick=
"toggleDisplay(document.getElementById('middle').contentDocument.getElementById('inner'))"> Inner frame display
34 <input type=
"checkbox" checked=
"true" onclick=
"toggleVisibility(document.getElementById('middle'))"> Outer frame visibility
37 <input type=
"checkbox" checked=
"true" onclick=
"toggleVisibility(document.getElementById('middle').contentDocument.getElementById('inner'))"> Inner frame visibility
40 <input type=
"checkbox" checked=
"true" onclick=
"toggleVisibility(document.getElementById('middle').contentDocument.getElementById('inner').contentDocument.getElementById('plugin'))"> Inner plugin visibility
45 <iframe id=
"middle" style=
"height: 400px; width: 400px;" src=
"resources/nested-plugins-outer-frame.html"></iframe>