Example 1 — Quick demo
Core Custom Elements.
JavaScript
console.log(typeof customElements);
console.log("customElements.define('my-el', class extends HTMLElement {})");How It Works
- define. Register a tag name.
- HTMLElement. Extend for behavior.
Custom Elements let you define new HTML tags with JavaScript classes via customElements.define.
| Topic | Summary |
|---|---|
basics | core Custom Elements usage. |
console.log(typeof customElements);
console.log("customElements.define('my-el', class extends HTMLElement {})");Core Custom Elements.
console.log(typeof customElements);
console.log("customElements.define('my-el', class extends HTMLElement {})");CODETOFUN NEWS
Get the latest IT news, programming updates, and technology trends directly on your phone.
Your daily dose of tech, straight to your feed.
6 people found this page helpful