Why isn't my JavaScript working in JSFiddle?

前端 未结 7 1341
萌比男神i
萌比男神i 2020-11-21 05:11

I can\'t find out what is the problem with this JSFiddle.

HTML:


Jav

7条回答
  •  一整个雨季
    2020-11-21 05:25

    Select OnDomready
    

    HTML:

    
    

    JavaScript:

    addEventListener('load', init, false);
    
    function init()
    {
      oInput = document.getElementById('dButton');
      oInput.onclick = test;
    }
    
    function test(){
      alert("test");
    }
    

提交回复
热议问题