我試圖用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