textContent empty in connectedCallback() of a custom HTMLElement
问题 Within the connectedCallback() method of my custom element the textContent is returned as an empty string. Essentially my code boils down to the following... class MyComponent extends HTMLElement{ constructor() { super() console.log(this.textContent) // not available here, but understandable } connectedCallback() { super.connectedCallback() // makes no difference if present or not console.log(this.textContent) // not available here either, but why?! } } customElements.define('my-component',