i have 'ul li', where is text, i want that when text in 'li' changes after click happen something, for example console.log. here is my code example:
html:
<ul>
<li>first</li>
</ul>
<button>click</button>
javascript:
document.queryselector('button').addEventListener('click', function(){
let list = document.queryselector('li');
let text = list.innerHTML = 'second';
if(list.changed){
console.log(changed);
}
});
':let text = list.innerHTML = 'second';querySelector=>Sneed to be capital. Also, i am not sure what islist.changed? There is nothing likechangedin Javascript - Can you add what are you trying to do ?