vendredi 20 mars 2015

Check if checkbox is checked using JavaScript

I am trying to check multiple checkboxes, and return their values. I already tried multiple things, but I do not want to use jQuery.



<input type="checkbox" id="check1">

var checkbox = document.getElementById("check1");
if(checkbox.checked == true){ //code }


For some reason I just can't find any working code.





Aucun commentaire:

Enregistrer un commentaire