When I put this code in my console, I end up with a checked box in my web page:
$('body').append($('<input/>', {
type: 'checkbox',
value: "foo",
checked: false
}));
When I remove the checked attr altogether, the box is not checked:
$('body').append($('<input/>', {
type: 'checkbox',
value: "foo",
}));
...but I need a dynamic set of checkboxes to be generated, some checked and some not. What attr/value creates the correct "unchecked" state?
Aucun commentaire:
Enregistrer un commentaire