blob: d953beb6d7c218db65024a728055037afdba946d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
<!doctype html>
<template id="tmpl">
<div style="display: table">
Some text
<span style="display: table-cell">something</span>
More text
</div>
</template>
<div id="host"></div>
<script>
let shadowRoot = document.getElementById("host").attachShadow({mode: 'open'});
let tmpl = document.getElementById("tmpl");
shadowRoot.appendChild(document.importNode(tmpl.content, true));
document.body.offsetTop;
shadowRoot.firstElementChild.querySelector("span").remove();
</script>
|