user319854
user319854

Reputation: 4106

jquery, unselect checkbox by value

i have many checkbox:

    <input type="checkbox" name="checkbox_user" value = "1"/>
    <input type="checkbox" name="checkbox_user" value = "2"/>   
    <input type="checkbox" name="checkbox_user" value = "3"/>
...

and checkbox with value 2 is selected. Is possible unselect checkbox (with jQuery) when i now only value.

Upvotes: 18

Views: 15828

Answers (1)

jtbandes
jtbandes

Reputation: 118651

$("input:checkbox[value=2]").attr("checked", true);

Upvotes: 48

Related Questions