javascript TypeError: document.getElementsByTagName(“p”)[0].innerHtml is not a function

innerHTML but not innerHtml, and it is not a function, you should set the string to this property.

document.getElementsByTagName("p")[0].innerHTML = "hello my name is vaani";

Leave a Comment