xxxxxxxxxx
$('input[name="checkboxGroup"]:checked'); // returns checked input objects
xxxxxxxxxx
$('#checkbox_id:checked').val();
//if checkbox is selected than gets its value
xxxxxxxxxx
console.log($('input[name="locationthemes"]:checked').serialize());
//or
$('input[name="locationthemes"]:checked').each(function() {
console.log(this.value);
});
xxxxxxxxxx
var selected = [];
$('#checkboxes input:checked').each(function() {
selected.push($(this).attr('name'));
});
jquery get selected checkbox values
xxxxxxxxxx
var selectedLanguage = new Array();
$('input[name="language"]:checked').each(function() {
selectedLanguage.push(this.value);
});
xxxxxxxxxx
$("#merge_button").click(function(event){
event.preventDefault();
var searchIDs = $("#find-table input:checkbox:checked").map(function(){
return $(this).val();
}).get(); // <----
console.log(searchIDs);
});
xxxxxxxxxx
$("#check").change(function () {
if (this.checked) {
//I am checked
name_val = $('#name').val();
$('#player').val(name_val);
} else {
//I'm not checked
$('#player').val('');
}
});