I have a document which is rendered to a following structure:
<tr>
<td>
<div class="csLabel">
<label for="common_id">Label</label>
</div>
</td>
<td>
<div class="csFields">
<select id="common_id" name="someName">
<option value="">some options...</option>
</select>
</div>
</td>
</tr>
There are many elements of such on a page and I want to hide only few of them. As you can see, there are two elements: a label
and select
. They both share the same value common_id
but in label
it is assigned to for
attribute and in select
it is id
.
Is there a way to get all such elements that use the value common_id
?