简化问题'<div class="productCart" id="' + productId + '_cart">' + productName + '<a href="#">remove</a><br />qty: <span class="quantity">1</span><br />price: <span class="price">' + productPrice + ' $</span></div>基本解决了!
就是有一个不爽的地方,为什么从上面这个div中取出的值是remove而不是productName 呢?$('#cartProducts .productCart').each(
function()
{
cartPNameA = $(':first',this).text();
}
); 这下应该有回答了吧?
谢谢
就是有一个不爽的地方,为什么从上面这个div中取出的值是remove而不是productName 呢?$('#cartProducts .productCart').each(
function()
{
cartPNameA = $(':first',this).text();
}
); 这下应该有回答了吧?
谢谢
这个方法是行的,但是<P> 会换行的,影响页面美观,有没有可以替换的呢?谢谢您的回复!
<dd></dd>
呵呵.
<span></span>