поставете отметка в квадратчето jquery
$('#grepperRocks').prop('checked', true);
Събитие промени отметка на jQuery
//jQuery listen for checkbox change
$("#myCheckBoxID").change(function() {
if(this.checked) {
//I am checked
}else{
//I'm not checked
}
});
jquery поставете отметка в квадратчето
$('.myCheckbox').prop('checked', true);
$('.myCheckbox').prop('checked', false);
промоции на флажке в jquery
$(document).ready(function() {
//set initial state.
$('#textbox1').val($(this).is(':checked'));
$('#checkbox1').change(function() {
if($(this).is(":checked")) {
var returnVal = confirm("Are you sure?");
$(this).attr("checked", returnVal);
}
$('#textbox1').val($(this).is(':checked'));
});
});
поставете отметка в квадратчето при натискане на jquery
$(document).ready(function() {
//set initial state.
$('#textbox1').val($(this).is(':checked'));
$('#checkbox1').change(function() {
$('#textbox1').val($(this).is(':checked'));
});
$('#checkbox1').click(function() {
if (!$(this).is(':checked')) {
return confirm("Are you sure?");
}
});
});
поставете отметка в квадратчето натиснете събитие jquery
$('input[type="checkbox"]').click(function(){
if($(this).is(":checked")){
//input element where you put value
$("#isClicked").val("Yes");
// console.log($("#isClicked").val());
}
else if($(this).is(":not(:checked)")){
$("#isClicked").val("");
// console.log( $("#isClicked").val());
}
});