Javascript实现购物车案例--Javascript学习

这篇博客通过JavaScript演示了如何设计并实现一个购物车功能,涵盖了HTML、CSS和JS代码的详细说明。
摘要由CSDN通过智能技术生成

JavaScript实现购物车来进行设计一个购物车的功能

html代码:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>购物车</title>
		<link rel="stylesheet" type="text/css" href="shoppingCar.css"/>
		
	</head>
	<body>
		<div class="shoppingCar">
			<table id="tableShop">
				<thead>
					<tr>
						<th>
							<label><input type="checkbox" class="check_all check"></label>
							全选
						</th>
						<th>商品</th>
						<th>单价</th>
						<th>数量</th>
						<th>小计</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td class="checkbox"><input type="checkbox" class="check_one check"></td>
						<td class="goods"><img src="image/1.jpg"><span>Sony/索尼 DSC-WX300</span></td>
						<td class="price">1999</td>
						<td class="count">
							<span class="reduce">-</span>
							<input type="text" class="count-input" value=" 1" />
							<span class="add">+</span>
						</td>
						<td class="xj">1999</td>
						<td class="operation">
							<span class="delete">删除</span>
						</td>
					</tr>
					<tr>
						<td class="checkbox"><input type="checkbox" class="check_one check"></td>
						<td class="goods"><img src="image/2.jpg"><span>Casio/卡西欧 EX-TR350</span></td>
						<td class="price">2999</td>
						<td class="count">
							<span class="reduce">-</span>
						<input type="text" class="count-input" value="1 " />
							<span class="add">+</span>
						</td>
						<td class="xj">2999</td>
						<td class="operation">
							<span class="delete">删除</span>
					</tr>
					<tr>
						<td class="checkbox"><input type="checkbox" class="check_one check"></td>
						<td class="goods"><img src="image/3.jpg"><span>Canon/佳能 PowerShot SX50 HS</span></td>
						<td class="price">3999</td>
						<td class="count">
							<span class="reduce">-</span>
							<input type="text" class="count-input" value="1" />
							<span class="add">
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值