selector - jQuery - How to match an element has attribute a or attribute b -


how write jquery selector match element has attribute or attribute b. must match 3 elements below

<a a="123" b="345"></a> <a a="123"></a> <a b="345"></a> 

you can use multiple selector (,) attribute-equals selector (or other selectors), example:

$("a[a=123], a[b=345]") 

you can test out here.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -