I am trying to work out how to select a container by a link contained within it. It looks something like this:
<div>
<p>Some text here</p>
<a href="www.test.com">My Link</a>
</div>
I know the value of "My link". However, the div has no ID or class and is not contained within anything except the body.
How could I use javascript to select the div element so I can manipulate it? I've found ways to select the link using the DOM but not the outer div. There are many divs on the page, so I cannot just select div.
Your help is appreciated!