Javascript - select tag with specific criteria

this is a follow up of my last question

In JS, I want a ul tag that contains li where class starts with jsx that contains a tag where href starts with /search…

try the following
document.querySelectorAll("ul li[class^='jsx']:has(a[href^='/search']:not([hidden]))");

1 Like

Hi @bs113256

Try this:

document.querySelectorAll('ul li[class^="jsx"] a[href^="/search"]');

Hope it helps!!

1 Like

@Parvathy @jack.chan thanks both

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.