JavaScript button onclick not working

前端 未结 5 851
无人及你
无人及你 2021-01-07 07:57



        
5条回答
  •  感情败类
    2021-01-07 08:09

    There is no problem with your code.. run this snippet

    function hello() {
    alert('Hello');
    }

    and if you want to alert this on window load. change your code like this way

    (function(){
      alert('hello')
    })();

提交回复
热议问题