mirror of
https://github.com/microsoft/playwright.git
synced 2024-11-29 01:53:54 +03:00
18 lines
479 B
HTML
18 lines
479 B
HTML
<script>
|
|
|
|
let h1 = null;
|
|
window.button = null;
|
|
let clicked = false;
|
|
|
|
window.addEventListener('DOMContentLoaded', () => {
|
|
const shadowRoot = document.body.attachShadow({mode: 'open'});
|
|
h1 = document.createElement('h1');
|
|
h1.textContent = 'Hellow Shadow DOM v1';
|
|
button = document.createElement('button');
|
|
button.textContent = 'Click';
|
|
button.addEventListener('click', () => clicked = true);
|
|
shadowRoot.appendChild(h1);
|
|
shadowRoot.appendChild(button);
|
|
});
|
|
</script>
|