Na co wskazuje element this?
window.getElementById(“XXX”)
.addEventListener(‘focus’, () => {
console.log(this);
})
Na co wskazuje element this?
window.getElementById(“XXX”)
.addEventListener(‘focus’, () => {
console.log(this);
})
Na window nie można wykonać metody getElementById tylko na dokument DOM
window.getElementById(“XXX”)
.addEventListener(‘focus’, () => {
console.log(this);
})
window.document.getElementById("xxx").addEventListener("focus", ()=> {console.log(this)}); // Zwróci ci Window