試圖添加一個'sup'標籤到下面。它的工作原理是克隆它看到的第一個價格,爲什麼?jQuery替換是克隆,我需要它爲每個元素
<font class="pricecolor colors_productprice specialprice">
<span class="PageText_L483n">
<font class="text colors_text"><b>Regular Price:</b></font>
<span class="priceis strike">$2,533.31</span> </span>
</font>
<font class="pricecolor colors_productprice specialprice">
<span class="PageText_L483n">
<font class="text colors_text"><b>Regular Price:</b></font>
<span class="priceis strike">$288.00</span> </span>
</font>
<font class="pricecolor colors_productprice specialprice">
<span class="PageText_L483n">
<font class="text colors_text"><b>Regular Price:</b></font>
<span class="priceis strike">$1,055.00</span> </span>
</font>
$(document).ready(function(){
$('font.pricecolor').html(
$('.pricecolor').html().replace(/\.\d{1,2}/,
function(a){
return '<sup>' + a + '</sup>';
})
);
});
*喘氣* FONT標籤! – mattsven 2011-05-12 18:30:29
我使用Volusion^O.o – ToddN 2011-05-12 18:33:35