[go: nahoru, domu]

blob: 2c10d246ddaf4516da8b89690ac64343db3208b6 [file] [log] [blame]
<!--
Copyright 2023 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<script>
class CustomElement extends HTMLElement {
constructor() {
super();
const shadow = this.attachShadow({ mode: 'open' });
shadow.innerHTML = `<button id="test">Click me</button>`;
}
}
customElements.define('custom-element', CustomElement);
function addMore() {
setTimeout(() => {
document.body.append(new CustomElement());
}, 100);
}
</script>
<custom-element onclick="addMore();"></custom-element>