ok im new at javascript, but im trying to change the innerhtml of a div tag, heres my script and its not working:
correct:
window.onload = var1;
in your example value of window.onload is undefined because function var1 returns nothing (undefined). You should set onload property to function var1, not result of calling function var1()
undefined