class Form extends HTMLElement {
constructor() {
super()
}
connectedCallback() {
console.log(this)
console.log(this.innerHTML)
}
}
customElements.define("my-form", Form);
I'm trying to access the innerHTML now for console.log(this)
if I expand it in the console innerHTML is set but when I try console.log(this.innerHTML)
it logs nothing.
how come even in the connectedCallback i cant access anything inside my tags.
ultimately what I'm trying to do is
class Form extends HTMLElement {
constructor() {
super()
}
connectedCallback() {
let inputCounter = 0
for (let i of this.querySelectorAll("input")) {
this[inputCounter] = i
inputCounter++
}
}
}
customElements.define("my-form", Form);
but I cant do it because I cant access anything inside the element.