<my-ce></my-ce>

<script>
  class MyCe extends HTMLElement {
    constructor() {
      super()
      this.textContent = 'Hello, World!'
    }
  }
  customElements.define('my-ce', MyCe)
</script>

Define custom element

The custom element is defined using the customElements.define() method. The first argument is the name of the custom element, and the second argument is the class that defines the custom element.