Quantcast
Browsing all 28 articles
Browse latest View live

Answer by John Boker for Check if checkbox is checked with jQuery

$('#' + id).is(":checked") That gets if the checkbox is checked. For an array of checkboxes with the same name you can get the list of checked ones by: var $boxes = $('input[name=thename]:checked');...

View Article


Check if checkbox is checked with jQuery

How can I check if a checkbox in a checkbox array is checked using the id of the checkbox array? I am using the following code, but it always returns the count of checked checkboxes regardless of id....

View Article


Answer by Kamil Kiełczewski for Check if checkbox is checked with jQuery

Your question is not clear: you want to give "checkbox array id" at input and get true/false at output - in this way you will not know which checkbox was checked (as your function name suggest). So...

View Article

Answer by Rtronic for Check if checkbox is checked with jQuery

this is also idea i use it usuallyvar active = $('#modal-check-visible').prop("checked") ? 1 : 0 ; if cheked will return 1 else will return 0

View Article

Answer by infomasud for Check if checkbox is checked with jQuery

$(document).on('click','#checkBoxId',function(){ var isChecked = $(this).is(':checked'); console.log(isChecked);});This code above works also on bootstrap modal. isChecked is true or flase ;

View Article


Answer by oscar castellon for Check if checkbox is checked with jQuery

Try this...$(function(){ $('body').on('click','.checkbox',function(e){ if($(this).is(':checked')){ console.log('Checked') } else { console.log('Unchecked') } })})

View Article

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...

View Article

Answer by lisandro for Check if checkbox is checked with jQuery

Just use the [0] index of the jquery object, and checked will work.$(elem)[0].checked

View Article

Browsing all 28 articles
Browse latest View live