Why isn't using innerHtml changing text inside <p> tag | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Why isn't using innerHtml changing text inside <p> tag

https://code.sololearn.com/W2Jr0vvG0RMQ/?ref=app

9th Apr 2020, 9:11 AM
Abhay
Abhay - avatar
5 Answers
+ 2
innerHTML, not innerHtml (case sensitivity)
9th Apr 2020, 9:31 AM
visph
visph - avatar
+ 1
and a[0].innerHTML, as getElementsByTagName return an array-like object (node collection)... notice the 's' in getElementsByTagName ... while there's not in getElementById ;)
9th Apr 2020, 9:34 AM
visph
visph - avatar
+ 1
Wow I saw that in comments innerHTML but I thought that innerHtml was working right because it did(probably that was innerText!) maybe I didn't noticed clearly! Thks
9th Apr 2020, 9:34 AM
Abhay
Abhay - avatar
0
Yup thks:-)
9th Apr 2020, 9:40 AM
Abhay
Abhay - avatar
- 2
th CJ CM
28th May 2020, 7:21 AM
rohit pandey