Shopping Cart front page code

Source: Internet
Author: User

<!doctype html>
<meta charset= "UTF-8" >
<title> Shopping Cart Automatic pricing </title>
<script type= "Text/javascript" src= "Jquery-min.js" ></script>
<script type= "Text/javascript" >
$ (function () {
$ (". SE"). Change (function (Oeven) {
var num = $ (this). Find ("option:selected"). Text ();
var Price = $ (This). Parent (). Next (). text ();
$ (this). Parent (). Next (). Next (). text (Num*price);
Getinall ();//Calculate the price of all items
});
})

function Getinall ()
{
var len = $ ("#PriceTable tbody"). Children ("tr"). Length;
var pricecount=0;
for (Var i=0;i<len;i++)
{
var tempdata=rows[i];
var Price1 = $ ("#PriceTable tbody tr:eq (" +i+ ") Td:eq (4)"). text ();
Pricecount=parsefloat (Pricecount) +parsefloat (Price1);
}
$ ("#PriceTable tfoot tr td:eq (1)"). Text (Pricecount);
}
</script>
<style type= "Text/css" >
Table input[type=text]{width:32px;}
</style>
<body>

<div>
<table id= "Pricetable" >
<thead><tr><td> Item number </td><td> item name &LT;/TD&GT;&LT;TD > Quantity </td><td> Price </td><td> Subtotal </td></tr></thead>
<tbody>
<tr>
&LT;TD >jsp_123</td>
&LT;TD > Computers </td>
<td>
<select name= "se" class= "se" >
<option value= "1" >1</option>
<option value= "1" >2</option>
<option value= "1" >3</option>
<option value= "1" >4</option>
<option value= "1" >5</option>
</select>
</td>
&LT;TD >1950</td>
&LT;TD >1950</td>
</tr>
<tr>
&LT;TD >jsp_123</td>
&LT;TD > Computers </td>
<td>
<select name= "se" class= "se" >
<option value= "1" >1</option>
<option value= "1" >2</option>
<option value= "1" >3</option>
<option value= "1" >4</option>
<option value= "1" >5</option>
</select>
</td>
&LT;TD >1950</td>
&LT;TD >1950</td>
</tr>
<tr>
&LT;TD >jsp_123</td>
&LT;TD > Computers </td>
<td>
<select name= "se" class= "se" >
<option value= "1" >1</option>
<option value= "1" >2</option>
<option value= "1" >3</option>
<option value= "1" >4</option>
<option value= "1" >5</option>
</select>
</td>
&LT;TD >1950</td>
&LT;TD >1950</td>
</tr>

</tbody>
<tfoot>
<tr><td> Total: </td><td colspan= "4" >5850</td></tr>
</tfoot>
</table>
</div>
<input type= "button" onclick= "Getinall ()" Value= calculation "/>
</body>

Shopping Cart front page code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.