blob: 9cfa6f477bfd4563ec495be6e1c7504201fb0170 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
<!DOCTYPE html>
<html>
<head>
<script src="386310-script.js"></script>
<script>
customElements.define("custom-element", class extends HTMLElement {
constructor() {
super();
const template = document.getElementById("template");
const shadowRoot = this.attachShadow({mode: "open"})
.appendChild(template.content.cloneNode(true));
}
});
</script>
</head>
<body>
<template id="template">
<span></span>
<slot></slot>
</template>
<custom-element id="test" style="display: block;">first second third [fourth]</custom-element>
</body>
</html>
|