lundi 25 juin 2018

Checking if checkbox is checked or not Javascript

I am trying to determine in code whether a checkbox is checked or not, looking at this: w3 Schools Checkbox checked source, I changed the code around a bit to look like this:

           if(document.getElementById("option_seo").checked == true)
           {
            var seo = parseInt(document.getElementById("option_seo").value;
           }

and that does not work. I have seen solutions around overflow that deal with for loop statements and I don't believe my situation is needing a for statement, if anyone is able to assist me in this, that would be great! Thanks!




Aucun commentaire:

Enregistrer un commentaire