Using an HTML button to call a JavaScript function

前端 未结 10 1642
我在风中等你
我在风中等你 2020-11-22 09:59

I am trying to use an HTML button to call a JavaScript function.

Here\'s the code:



        
10条回答
  •  一生所求
    2020-11-22 10:28

    silly way:

    onclick="javascript:CapacityChart();"
    

    You should read about discrete javascript, and use a frameworks bind method to bind callbacks to dom events.

提交回复
热议问题