+ 1
InnerHTML won't change firstChild
I've changed code slightly to use firstChild but it doesn't update the result, original code is commented off for comparison, why isn't it working? https://code.sololearn.com/WU9RUlQgu22Z/?ref=app
3 Respostas
+ 1
This one worked:
a.childNodes[1].innerHTML = "new text"
0
guess firstChild is ok for lists
0
Drax, yes this "array" approach works. I just wonder why firstChild/lastChild way isn't doing anything. Alerting firstChild.innerHTML does display the value but as Claudiu Stefan Haidu said it must be that it only works for listing and not for making any changes. Thanks guys.