<!-- | |
Copyright 2022 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 CustomButton extends HTMLElement { | |
constructor() { | |
super(); | |
const shadow = this.attachShadow({ mode: 'open' }); | |
shadow.innerHTML = `<slot></slot>`; | |
} | |
} | |
customElements.define('custom-button', CustomButton); | |
</script> | |
<custom-button>Click me</custom-button> |