Test

var foo, bar document.write(foo);

1 Response

<script>
class ConfirmationModal extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
</style>
<div id="modal">
<slot></slot>
<button id="close">Close</button>
</div>
`;
this.shadowRoot.querySelector('#close').addEventListener('click', () => {
this.style.display = 'none';
});
}
}
customElements.define('confirmation-modal', ConfirmationModal);
</script>

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.