How do I change the content of the cell containing the \'c\' letter in the HTML sample using jQuery?
6条回答 粉色の甜心 (楼主) 2020-12-29 03:52 $("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); } 0 讨论(0) 查看其它6个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
$("td:contains('c')").html("new");
or, more precisely $("#table_headers td:contains('c')").html("new");
$("#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); }