Using an HTML button to call a JavaScript function

前端 未结 10 1644
我在风中等你
我在风中等你 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:08

    Your code is failing on this line:

    var RUnits = Math.abs(document.all.Capacity.RUnits.value);
    

    i tried stepping though it with firebug and it fails there. that should help you figure out the problem.

    you have jquery referenced. you might as well use it in all these functions. it'll clean up your code significantly.

提交回复
热议问题