<my-ce name="Initial Name"></my-ce>// [!code focus]
<script>
  class MyCe extends HTMLElement {
    constructor() {
      super()
      this.textContent = 'Hello, World!'
    }
    static get observedAttributes() {
      return ['name']
    }
    attributeChangedCallback(name, oldValue, newValue) {
      if (name === 'name') {
        this.textContent = newValue
      }
    }
  }
  customElements.define('my-ce', MyCe)
</script>// [!code focus]

Done 🎉

Now you can set name attribute with <my-ce name="New Name"></my-ce> and see the text content change.