我有以下html我无法编辑html:
<tr>
<td>
<font class="text colors_text"><span class="percarton" style="font-weight: normal;"><font class="text colors_text">
<b>Price Per Carton </b></font></span><span class="csqft_price">$101.82</span></font><br>
<b> <span class="percarton" style="font-weight: normal;">Members Price 1: </span>
<span class="csqft_price"><font class="pricecolor colors_productprice">$96.82<br>
</font></span></b>
</td>
</tr>
每当html中有成员价格时,每个纸箱价格的<span class="csqft_price"></span>
都应该被移除,并且在删除字体标记之前,它应该被<span class="csqft_price"></span>
所示为$ {0.}}。请指教。
答案 0 :(得分:0)
function removeClass(el, name) {
var classes = el.className || '',
bits = classes.split(' '),
str = '',
len = bits.length,
i = 0;
for (; i < len; i++) {
if (bits[i] != name) str += bits[i] + ' ';
};
el.className = str;
};