使用<代码>.each()穿过一个阵列,并试图使用<代码>replace(<>>>replace(<>>>>>t;br>,改为“(一般简单)但无所作为,仅取代。
//get values of each td in row
var values = ;
var tds = $(this).find( td );
$.each(tds, function(index, tditem) {
values = values + "td" + : + tditem.innerHTML +
;
values = values.replace(/<br>/i, " ");
});
Acknowledging that it would be better to manipulate a DOM element (and selecting one of those answers as the correct answer) I ended up adding this to my function as it just makes my life easier in the short-term:
values = values.replace(/<br>/i, " ");
感谢@all