You can use a multiple selector (,
) with the attribute-equals selector (or any other selectors), for example:
$("a[a=123], a[b=345]")
You can test it out here.
Try this
$('a[b="345"],a[a=123] ')
See the jQuery Multiple selector docs.
Or generally for mere presence of attribute
$("a[a], a[b]")