function change(){
var a = document.getElementsByTagName("p");
for(var x = 0 ; x < a.length ; x++){
a[x].innerHTML = "hello" ;}}
change();
I just want to change content of all p
tags , but I can't call this function , I know it will be working if I add window.onload = this function
. But I don't know why I can't use the way above to call this function. Pls explain for me .