summaryrefslogtreecommitdiffstats
path: root/remote/test/puppeteer/test/assets/shadow.html
blob: cd64eb0faf3a96d474cd5ccf90d479873343c4d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!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>