Click here to Skip to main content
16,015,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all i have an array of checkboxes in html , i want when i click on a checkbox to know if it is checked or unchecked.
using js

Thank you
Posted

1 solution

Hi,

You can use like below to call the javascript function on click,

HTML
<input id="chkInterest1" type="checkbox" name="chkInterest1" onclick="if(this.checked){myFunction()}"/><label for="chkInterest1">Interest1</label>


Hope this helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900