Onclick() function on working

后端 未结 4 1087
名媛妹妹
名媛妹妹 2020-12-22 13:40

all! I am having a problem using the a simple onclick method. Kindly please help me out. Here is that code... When i click on the button nothing really happens.



        
4条回答
  •  天涯浪人
    2020-12-22 14:14

    Onclick should be a function, not a statement. Try

    btn.onclick=function(){ 
      alert('hi');
    }
    

提交回复
热议问题