How do I change the content of the cell containing the 'c' letter in the HTML sample using jQuery?
<table id="table_header"> <tr> <td>a</td> <td>b</td> <td>c</td> </tr> </table>
Thanks.
$("td:contains('c')").html("new");
or, more precisely $("#table_headers td:contains('c')").html("new");
and maybe for reuse you could create a function to call
function ReplaceCellContent(find, replace) { $("#table_headers td:contains('" + find + "')").html(replace); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With