How to write a jquery selector to match an element has an attribute a or attribute b. It should match the three elements below
<a a="123" b="345"></a> <a a="123"></a> <a b="345"></a>
You can use multiple selector ( ,) with attribute selector (or any other selectors), for example:
,
$("a[a=123], a[b=345]")
You can check it out here .
Or generally for the mere presence of an attribute
$("a[a], a[b]")
$('a[b="345"],a[a=123] ')
jQuery Multiple selector docs.
Source: https://habr.com/ru/post/1768609/More articles:Ant оператор if - anthow to create a real-time text editor (multi-user) in ajax - ajaxЧто подразумевается под статически перемещенным или статическим перемещением сегмента - memory-managementMake .find case insensitive - javascriptSorting results by "most relevant" - MYSQL and PHP - sortingHow can I parse incomplete XML fragments using Perl XML :: Twig? - xmlHow etags handle multiple directories - c ++JMenu help to open an html page on a local machine - javahttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1768613/how-to-ensure-that-when-my-process-is-operating-on-a-file-no-other-process-tries-to-write-to-it-or-delete-it&usg=ALkJrhgODa7VLyKtCCXvKtLk2nLwSw-ldwQt problem: there is no QProgressBar animation with minimum and maximum steps set to 0 - c ++All Articles