A cleaner way to select by multiple possible attribute values?

Not that I know of. The cleanest way I can think of doing this is to first select using the common elements across all items, then just .find() or .filter() the OR values out.

Something like

$('#list1 > option[value]')
    .filter('[value="1"],[value="2"]')
    ;

Leave a Comment