-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbook.html
More file actions
38 lines (38 loc) · 764 Bytes
/
book.html
File metadata and controls
38 lines (38 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<html>
<head>
<style>
table,th,tr,td{border: 1px solid black}
</style>
</head>
<body>
<table>
<th>Book Name</th>
<th>Price</th>
<tr>
<td>Da vinci Code</td>
<td>Rs.599/-</td>
</tr>
<tr>
<td>Harry Potter</td>
<td>Rs.699/-</td>
</tr>
</table>
<p>Select the required books</p>
Da vinci Code:
<input type="checkbox" value=599 id="id1"><br>
Harry Potter:
<input type="checkbox" value=699 id="id2"><br>
<button onclick="book()">Buy</button>
<p id="buy"></p>
<script>
function book(){
var m=document.getElementById("id1");
var n=document.getElementById("id2");
var sum=0;
if(m.checked == true){sum=sum+599;}
if(n.checked == true){sum=sum+699;}
document.getElementById("buy").innerHTML="Total Amount ="+sum;
}
</script>
</body>
</html>