I have a simple cod, and I don't know why it is not working. When I click on the button, I want to uncheck the checkbox. I was trying with prop(), I was trying with attr(), and still nothing.
Maybe someone here can see the mistake?
HTML
<label>
<input type="checkbox">
</label>
<button>CLICK</button>
jQuery
var btn = $("button");
btn.on("click", function(){
var checked = $(label).find("input").prop("checked");
if (checked === true){
$("checked").prop("checked", false);
}
})
Aucun commentaire:
Enregistrer un commentaire