blob: 7ae7ccdf56ab8a9f6ed75478160ab74a8a61d703 [file] [log] [blame]
<!--
Copyright 2023 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<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>