Change onclick action with a Javascript function

前端 未结 8 1389
刺人心
刺人心 2020-12-02 12:14

I have a button:


When I click this button the first time, I want it to exe

8条回答
  •  旧时难觅i
    2020-12-02 12:43

    You could try changing the button attribute like this:

    element.setAttribute( "onClick", "javascript: Boo();" );
    

提交回复
热议问题