I'm attempting to identify the checkboxes associated with the link containing delete.jpg. Here's what I've tried so far:
<table>
<tr class="odd">
<td><input id="cbox1" type="checkbox"></input></td>
<td>some info here</td>
<td>some info here</td>
<td>some info here</td>
<td><a href="www.example.com"><img src="delete.jpg" alt="Delete"></img></a></td>
</tr>
<tr class="even">
<td><input id="cbox2" type="checkbox"></input></td>
<td>some info here</td>
<td>some info here</td>
<td>some info here</td>
<td><a href="www.example.com"><img src="delete.jpg" alt="Delete"></img></a></td>
</tr>
</table>
var x = window.content.document.querySelectorAll("input[type='checkbox' img[alt='Delete']");
Unfortunately, this doesn't seem to be working and it appears as though the image is being treated as part of the input element.
My goal is to find the ID of the checkbox in a row where there is a delete.jpg image. Just a reminder that the image is enclosed within a link.
I would appreciate any insights or suggestions, preferably in JavaScript. jQuery can also be an option. Thank you in advance!