How to write a jquery selector to match an element has attribute a or attribute b. It must match three elements below
<a a="123" b="345"></a>
<a a="123"></a>
<a b="345"></a>
How to write a jquery selector to match an element has attribute a or attribute b. It must match three elements below
<a a="123" b="345"></a>
<a a="123"></a>
<a b="345"></a>
You can use a multiple selector (,
) with the attribute-equals selector (or any other selectors), for example:
$("a[a=123], a[b=345]")