Quantcast
Viewing latest article 27
Browse Latest Browse All 28

Answer by Du-Lacoste for Check if checkbox is checked with jQuery

You can try either any of the ways preferred, as in jQuery or JavaScript.

Get the value as below and assign to the variable then you if-else statements as per your requirement.

var getVal=$('#checkbox_id').is(":checked"); // jQueryvar getVal=document.getElementById("checkbox_id").checked //JavaScriptif (getVal==true) { // perform task} else { // perform task }

Viewing latest article 27
Browse Latest Browse All 28

Trending Articles