Is there a possibility in jQuery to select by multiple possible attribute values without having to use a comma separated list of selectors.
So in stead of:
You can make a custom jQuery function like this:
$.fn.filterAttrVals = function (attr, vals) {
var filter = '[' + attr + '="' + vals.split(',').join('"],[' + attr + '="') + '"]';
return this.filter(filter);
};
For your example you could use it in the following way:
$('#list1 > option').filterAttrVals('value','1,2');