Quantcast
Channel: Check if checkbox is checked with jQuery - Stack Overflow
Viewing all articles
Browse latest Browse all 28

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

$
0
0

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 all articles
Browse latest Browse all 28

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>