On an older website using jquery and nodejs, I am working on some filtering tasks. My goal is to target the b
elements that are enclosed within a p
tag. Specifically, I only want to select those b
elements that do not have any text surrounding them.
The Target Element
<p><b>Some text</b></p>
What I Aim to Avoid
<p>Some other text and some other elements <a>link</a><b>Some text</b>
and some more text of the parent p
</p>
Is there a way to specifically target the first wrapped element while ignoring the second one? Is there a selector that can help achieve this?