我试图用jQuery在<span>
标签中换行标签。下面的代码不起作用。请指出我出错的地方。也请建议一个更好的/不同的方法。在html标签中换行文本
var mysearch = '(05/13/2012-11/13/2012)';
$('table:eq(0) tr:eq(1) th:contains("' + mysearch + '")').filter(function() {
return this.html().replace('(05/13/2012-11/13/2012)', '<span class = "red"> (05/13/2012-11/13/2012)</span>');
});
你可以让你的问题的小提琴 – 2013-05-14 17:56:27