I was trying call a function on check change of checkbox, but the method I written in javascript doesn’s calling. I am trying with following code
calling onchange on checkbox
<asp:CheckBox ID="CheckBox1" runat="server" onchange="fun();" />
function calling in javascript
function fun() { }
Debugger is not going thrue this function.
Also can we do it by jQuery easily?
Thanks,
jQuery:
plain JS
EDIT:
If the javascript code comes before the DOM element is created, you’ll need some sort of DOM ready function, like window.onload in plain JS. jQuery uses document ready, and a shortcut for that is :