我有这个
<tr><td>other</td><td>mytest</td></tr>
<tr><td>other</td><td>mytest</td></tr>
<tr><td>other</td><td>mytest</td></tr>
<tr><td>other</td><td>mytest</td></tr>
<tr><td>other</td><td>mytest</td></tr>
我想将 last td 中的文本替换为
<span>mytest</span>
我正在尝试这个,但我包装了td
不text
var r2 = new RegExp("mytest", 'i');
$(" tbody td").filter(function(){
return $(this).text().replace(/\s/g, "").match(r2) }
).wrap('<span class="label-success"></span>');