简化问题'<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();
                                          
                }
        ); 这下应该有回答了吧?
谢谢