javascript change innerhtml

前端 未结 7 1905
逝去的感伤
逝去的感伤 2021-02-13 04:04

ok im new at javascript, but im trying to change the innerhtml of a div tag, heres my script and its not working:




        
7条回答
  •  不知归路
    2021-02-13 04:28

    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()

提交回复
热议问题