A dropdown on my site calls an "onchange" function. I would like the function to select a checkbox for "Top Brands" (as seen below).
Can I find the text "Top Brands" between label tags and then find the 'for' attribute and then check the correct checkbox?
The difficulty is that the array of checkboxes is dynamic. It might not always be the same id. That is why I need to find "Top Brands" between the label tags.
================================================
<table cellspacing="1" cellpadding="1" border="0" class="radiobuttonlist" id="chkAllCatList">
<tbody>
<tr>
<td>
<input type="checkbox" name="chkAllCatList$0" id="chkAllCatList_0">
<label for="chkAllCatList_0">Boys ~ 0 -3 Months</label>
</td>
</tr>
...
<tr>
<td>
<input type="checkbox" name="chkAllCatList$215" id="chkAllCatList_215">
<label for="chkAllCatList_215">Top Brands</label>
</td>
/tr>
Can I find the text "Top Brands" between label tags and then find the 'for' attribute and then check the correct checkbox?
The difficulty is that the array of checkboxes is dynamic. It might not always be the same id. That is why I need to find "Top Brands" between the label tags.
================================================
<table cellspacing="1" cellpadding="1" border="0" class="radiobuttonlist" id="chkAllCatList">
<tbody>
<tr>
<td>
<input type="checkbox" name="chkAllCatList$0" id="chkAllCatList_0">
<label for="chkAllCatList_0">Boys ~ 0 -3 Months</label>
</td>
</tr>
...
<tr>
<td>
<input type="checkbox" name="chkAllCatList$215" id="chkAllCatList_215">
<label for="chkAllCatList_215">Top Brands</label>
</td>
/tr>