<divId="Arae">
<tableBorder="1"style="Text-align:center">
<thead>
<th>Product number</th>
<th>Product Name</th>
<th>Number of goods</th>
<th>Commodity price</th>
<th>Total Merchandise</th>
<th>Operation</th>
</thead>
<tbodyId="Tbody">
<tr>
<td>1</td>
<td>iphone4</td>
<td><inputType="Button"Value=" + "class="Ad"><spanclass="Count">0</span><inputType="Button"Value=" - "class="SB"></td>
<tdclass="Danjia">2000</td>
<td><spanclass="Price">0</span></td>
<td><inputType="Button"Value="Delete"class="Delete"></td>
</tr>
<tr>
<td>2</td>
<td>iphone4s</td>
<td><inputType="Button"Value=" + "class="Ad"><spanclass="Count">0</span><inputType="Button"Value=" - "class="SB"></td>
<td>2200</td>
<td><spanclass="Price">0</span></td>
<td><inputType="Button"Value="Delete"class="Delete"></td>
</tr>
<tr>
<td>3</td>
<td>iphone5</td>
<td><inputType="Button"Value=" + "class="Ad"><spanclass="Count">0</span><inputType="Button"Value=" - "class="SB"></td>
<td>2400</td>
<td><spanclass="Price">0</span></td>
<td><inputType="Button"Value="Delete"class="Delete"></td>
</tr>
<tr>
<td>4</td>
<td>iphone6</td>
<td><inputType="Button"Value=" + "class="Ad"><spanclass="Count">0</span><inputType="Button"Value=" - "class="SB"></td>
<td>4000</td>
<td><spanclass="Price">0</span></td>
<td><inputType= </tr>
<tr>
<td>5</td>
<td>iphone7</td>
<td><input type= "button" value= "+" class= "ad" & Gt;<span class= "Count" >0</span><input type= "button" value= "-" class= "SB" ></td>
<TD >7000</td>
<td><span class= "Price" >0</span></td>
<td><input type = "button" value= "delete" class= "delete" ></td>
</tr>
</tbody>
<tfoot>
<tr& Gt
<td> Total Items </td>
<td><span class= "Allcount" >0</span></td>
<td> Total Product </td>
<td><span class= "Allprice" >0</span></td>
<td><input type= "button" value= "Empty Shopping Cart" class= "alldelete" ></td>
</tr>
</tfoot>
</table>
</div>
#arae {
550px;
0 Auto;
Float:left;
}
span{
Color:black;
Text-decoration:none;
}
$(' #tbody ').On' Click ','. Delete ',function () {
$(This).Parent ().Parent ().Empty ();
Showallcount ();
Showallprice ();
});
$('. Alldelete ').On' Click ',function () {
$(' #tbody ').Empty ();
});
$(' #tbody ').On' Click ','. Ad ',function () {
var a =$(This).Next'. Count ').Text ();
a++;
$(This).Next'. Count ').Text (a);
var B = +$(This).Parent ().Next' TD ').Text ();
s = a*b;
$(This).Parent ().Next' TD ').Next' TD ').Children ().TextS;
Showallcount ();
Showallprice ();
}).On' Click ','. SB ',function () {
var a =$(This).Prev'. Count ').Text ();
a--;
$(This).Prev'. Count ').Text (a);
var B = +$(This).Parent ().Next' TD ').Text ();
s = a*b;
$(This).Parent ().Next' TD ').Next' TD ').Children ().TextS;
Showallcount ();
Showallprice ();
});
functionShowallcount () {
var allsum =0;
$('. Count ').eachfunction () {
Allsum = allsum + (+$(This).Text ());
$('. Allcount ').Text (allsum);
});
}
function showallprice () {
var allsum = 0;
$ ( ". Price '). each (function () {
Allsum = allsum + (+$ (this). Text ()) $ (text (allsum) }) }
Simulated Shopping cart Form