mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
19 lines
498 B
HTML
19 lines
498 B
HTML
<!DOCTYPE html>
|
|
<script>
|
|
|
|
let h1 = null;
|
|
window.button = null;
|
|
window.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>
|