javascript change innerhtml

前端 未结 7 1921
逝去的感伤
逝去的感伤 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:53

    Try changing onLoad to onload.

    function var1() {
      document.getElementById('test').innerHTML = 'hi';
    }
    window.onload = var1; // onload
    

提交回复
热议问题