First, you want to use :contains:
jQuery( "td:contains(text)" );
Then, you can use .next and .append:
jQuery( "td:contains(text)" ).next().append("Hello");
Here's a working snippet to demonstrate usage:
jQuery(function($) {
$("td:contains(Text to Find)").next().append(" Hello");
});
table {
border-collapse: collapse;
}
td {
border: 1px solid #ccc;
padding: 2px 5px;
}
| Some Text |
More Text |
YMT |
| Text to Find |
Modify: |
Do nothing here |