Display total from gridview column on check box selection using jquery

This code will display total amount when books from the book store is added to cart for purchase.
 
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Display price of all books Checkboxes selection in A GridView</title>
<script type='text/javascript'
src='https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js'></script>
<script type="text/javascript">
$(function () {
$('input:checkbox').click(function (e) {
calculateSum(4); // sum of 4th column
});

function calculateSum(colidx) {
total = 0.0;
$("tr:has(:checkbox:checked) td:nth-child(" + colidx + ")").each(function () {
total += parseFloat($(this).text());
});

$('#tot').text("Total amount to be paid: " + total.toFixed(2));
}
});
</script>
</head>
<body>

<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"
DataKeyNames="ID" >
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="chkSel" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ID" HeaderText="ID"
SortExpression="ID" />
<asp:BoundField DataField="BookName" HeaderText="Books"
SortExpression="BookName" />
<asp:BoundField DataField="Price" HeaderText="Price"
SortExpression="Price" />
</Columns>
</asp:GridView>
<br />
<br />
<p id="tot" />



</div>
</form>
</body>
</html> 
 
 
 Code Behind:
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
List<BookStore> listbooks = new List<BookStore>();

protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
BookStore books = new BookStore();
listbooks = books.AddtoCart();
this.GridView1.DataSource = listbooks ;
this.GridView1.DataBind();
}
}
}

public class BookStore
{

public int ID { get; set; }
public string BookName { get; set; }
public double Price { get; set; }

public List<BookStore> AddtoCart()
{
List<BookStore> eList = new List<BookStore>();

eList.Add(new BookStore() { ID = 1, BookName = "2 States", Price = 300 });
eList.Add(new BookStore() { ID = 2, BookName = "Five point someone", Price = 500 });
eList.Add(new BookStore() { ID = 3, BookName = "False Impression", Price = 1000 });
eList.Add(new BookStore() { ID = 4, BookName = "last League", Price = 300 });
eList.Add(new BookStore() { ID = 5, BookName = "Sherlek Homes", Price = 800 });
eList.Add(new BookStore() { ID = 6, BookName = "Revolution 20:20", Price = 900 });
return eList;
}