I\'m getting the following error for a simple function below:
TypeError: document.getElementsByTagName(\"p\")[0].innerHtml is not a function
use
document.getElementsByTagName("p")[0].innerHTML="hello my name is vaani";
innerHTML but not innerHtml, and it is not a function, you should set the string to this property.
innerHTML
innerHtml
document.getElementsByTagName("p")[0].innerHTML = "hello my name is vaani";