Mega Code Archive

 
Categories / JavaScript DHTML / Form Control
 

Is checked

<html> <head> <script language="JavaScript"> <!-- function cb1(f) {   if (f.checked) {      alert("Checkbox 1 is checked");   } } function cb2(f) {   if (f.checked) {      alert("Checkbox 2 is checked");   } } //--> </script> </head> <body> <form name="checkForm"> <input type="checkbox" checked name="c1" onClick="cb1(this.form.c1)">Item 1<br> <input type="checkbox" name="c2" onClick="cb2(this.form.c2)">Item 2 </form> </body> </html>