tags:

views:

38

answers:

1

Is there a way in JQuery to check checkboxes based on their value.

e.g. if I have 3 checkboxes with the value 'test' is there any way I can check them all based just on the fact that they have the value 'test'

+7  A: 
$(":checkbox[value=test]").attr("checked", true);

See:

Demo: http://jsfiddle.net/GNJ6t/

karim79