JavaScript购物车最基本的功能
程序员文章站
2023-12-24 17:04:09
javascript购物车最基本的功能:
javascript购物车最基本的功能:
<meta charset="utf-8" /> <title></title> <style type="text/css"> table{ border-collapse: collapse; } th{ width: 80px; height: 30px; } td{ text-align: center; line-height: 30px; }</style> <p class="box"> <table border="" cellpadding="" cellspacing=""> <thead> <tr> <th> <input id="checkedall" type="checkbox" />选择</th> <th> 商品</th> <th> 价格</th> <th> 数量</th> <th> 总价</th> <th> 操作</th> </tr> </thead> <tbody id="tb"> <tr> <td><input type="checkbox" /></td> <td>黄焖鸡米饭1</td> <td>10</td> <td><span class="jian">-</span> <input readonly="readonly" style="width: 30px;text-align: center;" type="text" value="1" /> <span class="jia">+</span></td> <td><span style="color: red;">10</span></td> <td><a style="cursor: pointer;">删除</a></td> </tr> <tr> <td><input type="checkbox" /></td> <td>黄焖鸡米饭2</td> <td>20</td> <td><span class="jian">-</span> <input readonly="readonly" style="width: 30px;text-align: center;" type="text" value="1" /> <span class="jia">+</span></td> <td><span style="color: red;">20</span></td> <td><a style="cursor: pointer;">删除</a></td> </tr> </tbody> </table>