var shangpin=document.getElementById('shangpin');
function tianjia(){
var con =confirm('确定添加该商品到购物车吗?')
var i=0;
var b=""
if(con){
document.getElementById('a').innerHTML+='<tr class="on"><td class="checkbox"><input class="check-one check" type="checkbox"></td><td class="goods"><img src="images\购物车男装.png" alt=""><span>优衣库精品男装</span></td><td class="price">79.90</td><td class="count"><span class="reduce"></span><input class="count-input" type="text" value="1"><span class="add">+</span></td><td class="subtotal">79.90</td><td class="operation"><span class="delete">删除</span></td></tr>';
document.getElementsByClassName('shopNum').innerText='1';
i++;
}
}
我这样运行后,除了 var con =confirm('确定添加该商品到购物车吗?')有效,其他功能都不能实现。怎么才能从一个页面动态添加商品到购物车页面呢?
1111