ITPub博客

首页 > IT职业 > IT图书 > 购物车遇到的一些问题

购物车遇到的一些问题

IT图书 作者:xxyg 时间:2021-09-09 09:04:51 0 删除 编辑




title

全选 商品 单价 数量 小计 操作
图片描述Casio/卡西欧 EX-TR350 6000 -+ 6000 删除
图片描述Casio/卡西欧 EX-TR350 6000 -+ 6000 删除
删除'; //table.firstChild.appendChild(tr); table.children[0].appendChild(tr); //console.log(rows); //或者使用cloneNode(); // var tr = rows[1]; // var cloneNode =tr.cloneNode(true); // table.appendChild(cloneNode); // rows.length+=1; // table.insertRow(rows.length-1); },false); //删除行功能 for( var z=1;z

css部分

*{
    padding: 0;
    margin:0;
    text-decoration: none;
}
.container-wrapper{
    width:1175px;
    height:600px;
    margin: 50px auto;

}
table{
      border: 1px solid rgb(226, 220, 255);
}
table td{
     border: 1px solid rgb(226, 220, 255);
     text-align: center;
}
input{
    display: inline-block;
    margin-right: 5px;
}
.header{
    height: 40px;
    background-color: rgb(226, 242, 255);
    color: #666;
}
.content span{
     display: inline-block;
     vertical-align: top;
     position: relative;
     top:40px;
}
.content .count{
    display: inline-block;
    width: 60px;
    height: 20px;
}
.td span{
    position:relative;
    display:inline-block;
    top: 3px;
    background-color: rgb(226, 242, 255);
}
.reduce{
    padding:0 2px;
}
.add{
    position: relative;
    left: -5px;
}
.hidden{
    display: none;
}

为某一类节点对象添加事件可以先获取到节点的集合,
for循环为每一个数组元素添加事件,在事件函数里使用this代表当前的
数组元素。
为啥动态添加的DOM,他的子元素没有事件效果?

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2865/viewspace-2799133/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-08-16

  • 博文量
    77
  • 访问量
    445