In my form i should apply two variety's of class based on the existence in array for that how do i filter?
this is my try:
<form>
<input type="checkbox" value="one" />
<input type="checkbox" value="two" />
<input type="checkbox" value="three" />
<input type="checkbox" value="four" />
<input type="checkbox" value="five" />
</form>
var names = ["one","two","three"];
$(":checkbox", "form").filter(function(){
return $(this).val() === names
}).addClass("blue")
$(":checkbox", "form").filter(function(){
return $(this).val() !== names
}).addClass("green")
but not works.. any correct way to get it done