I want to select first tag a
nested under either div with class article article_rubric_top
or with class article article_top article_right
I try:
$('div.article.article_rubric_top a:first,div.article.article_top.article_right a:first')
But get much less tags than expected. I wonder whether I should somehow separate nested tag selectors when I use multiple selectors?
Like this:
$('(div.article.article_rubric_top a:first),(div.article.article_top.article_right a:first)')
Upd: Minimal data example. I expect to match all three a
tags.
<div class="article article_rubric_top">
<a href="http://ua.korrespondent.net/showbiz/music/3899530-duet-potap-i-nastia-zaiavyv-pro-te-scho-yde-zi-stseny" class="article__img-link"></a>
</div>
<div class="article article_top article_right">
<a href="http://ua.korrespondent.net/ukraine/3899526-ukraintsi-pochaly-chastishe-yizdyty-v-rosiui" class="article__img-link">
<noscript><img src="https://kor.ill.in.ua/m/400x253/2072539.jpg"></noscript><img src="/i/blank.gif" data-href="https://kor.ill.in.ua/m/400x253/2072539.jpg" alt="Українці почали частіше їздити в Росію" class="article__img lzl"></a>
</div>
<div class="article article_rubric_top">
<a href="http://ua.korrespondent.net/ukraine/3899521-likari-dozvolyly-prodovzhyty-sud-nad-kokhanivskym" class="article__img-link">
</a>
</div>
Upd For some reason minimal example does not work as my actual example
Image of jquery run in browser
I get div
and a
tags instead of just a
tags.