I have several places on the page where there is text “Add” This text is in a td tag which is also just above an input with type=”hidden” and name=”ProductCode” EDIT: I want to remove the “Add’ from each td tag.
My guess is that I need something like
$("input:checkbox[name='ProductCode']").this('td').each.text('Add').remove;
This obviously throws and error and I have no idea if I am even close. Note: I only want to target these and not any other text on page that may have “Add”
<td valign="top">Add<input type="hidden" value="xxxxxxx" name="ProductCode"></td>
<td valign="top">Add<input type="hidden" value="yyyyyyy" name="ProductCode"></td>
<td valign="top">Add<input type="hidden" value="zzzzzzz" name="ProductCode"></td>
For the correct syntax read the jQuery documentation.
For your specific problem
Update to avoid cases where text starting with Add get messed up..