-
Notifications
You must be signed in to change notification settings - Fork 1
/
ShadowDOM.html
29 lines (25 loc) · 1.03 KB
/
ShadowDOM.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
<!DOCTYPE html>
<!-- saved from url=(0014)about:internet -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Shadow DOM</title>
</head>
<body>
<div id="non_host"></div>
<div id="shadow_host"></div>
<a href="http://watir.com/examples/scroll.html">scroll.html</a>
<script>
let shadowRoot = document.getElementById('shadow_host').attachShadow({mode: 'open'});
shadowRoot.innerHTML = `
<span class="wrapper" id="shadow_content"><span class="info">some text</span></span>
<div id="nested_shadow_host"></div>
<a href="scroll.html">scroll.html</a>
<input type="text" />
<input type="checkbox" />
<input type="file" />
`;
let nestedShadowRoot = shadowRoot.getElementById('nested_shadow_host').attachShadow({mode: 'open'});
nestedShadowRoot.innerHTML = `
<div id="nested_shadow_content"><div>nested text</div></div>
`;
</script>
</body></html>