I got jq code I need to convert to ->js<-. For me it doesn't make sense (cause jq is js), code is longer, it's time consuming (I'm not programmer) and give exactly the same effect... not to mention browser compatibility. But...
I want to select all link (a) elements inside lists (li) iterate over them, change values and so on.
In jq one simple line $('li').find('a'); and it works even if there is something more between li and a like:
<li>
<div>
<a href=''>inside div</a>
</div>
</li>
what is the equivalent of jq code in plain js? I did try querySelector querySelectorAll, filter etc. to no avail (for me it works only when a is a directly child of li).
BTW there is an excellent page I did find when searching for answers - http://youmightnotneedjquery.com/#contains_selector but I still having trouble with this... so any suggestion are appreciated.