我不知道这里是什么问题:
let input = document.querySelector('#adding-todo')
input.onclick = (e)=>{
console.log("Okey");
document.querySelector('.cards-details-container .todo-background .checkboxs').innerHTML += 'hello'
}
You should know that #adding-todo is a child of .checkboxs
此事件似乎仅触发一次!但是,当我删除行:document.querySelector('.cards-details-container .todo-background .checkboxs').innerHTML += 'hello'
时,我得到了正常的行为(每次单击输入都会触发事件)。
有人可以解释为什么会这样吗?那么解决方案是什么?
谢谢