Hello i am using two checkbox with the each loop and using javascript i want to change the value of the checkbox. The checkbox value getting set false with the use of javascript.but after clicking it it getting set to true but check sign is dot getting displayed on the checkbox. here is the javascript code:
$(".sp-modal-content a.btn-icon").each(function(){
console.log($(this));
$(this).click(function(){
($(this).attr('id'));
console.log($(this).find('input[type="checkbox"]').val());
if($(this).find('input[type="checkbox"]').is(":checked"))
{
alert("true");
$(this).find('input[type="checkbox"]').attr('checked',false);
}
else {
alert("false");
alert($(this).find('input[type="checkbox"]').val());
$(this).find('input[type="checkbox"]').attr("checked" ,"checked");
}
})
})
Aucun commentaire:
Enregistrer un commentaire