Custom Elements

These are a set of JavaScript APIs that allow you to define custom elements and their behavior, which can then be used as desired in your user interface.


RESETRUNFULL
customElements.define('word-count', WordCount, { extends: 'p' });class WordCount extends HTMLParagraphElement {
  constructor() {    // Always call super first in constructor
    super();    // Element functionality written in here
    ...
  }}…<word-count…>xxx</word-count>