forked from rathoresrikant/HacktoberFestContribute
-
Notifications
You must be signed in to change notification settings - Fork 0
/
marklist.html
65 lines (65 loc) · 1.41 KB
/
marklist.html
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<html>
<head>
<title></title>
<ttitle id="title">Marks</ttitle>
<style type="text/css">
body{
color:black;
background-color:#6ecc2d;
}
#title{
color:red;
background-color:blue;
display:block;
height:40px;
}
</style>
</head>
<body>
<table border="2px">
<tbody id="table">
<tr>
<th>Roll No.</th>
<th>Name</th>
<th>Marks</th>
<th>-</th>
</tr>
</tbody>
</table>
<br>
<br>
<br>
<form>
<input type="text" id="country" placeholder="Roll No.">
<input type="text" id="name" placeholder="Name">
<input type="text" id="role" placeholder="Marks">
<input type="file" id="browse" placeholder="browse">
<br>
<button id="add">Add</button>
<button id="substract">Erase</button>
</form>
<script type="text/javascript">
let country=document.getElementById("country");
let name=document.getElementById("name");
let roll=document.getElementById("role");
let table=document.getElementById("table");
let button=document.getElementById("add");
add.addEventListener("click",function (e)
{
e.preventDefault();
let row=document.createElement("tr");
let c=document.createElement("td");
c.innerHTML=country.value;
let n=document.createElement("td");
n.innerHTML=name.value;
let r=document.createElement("td");
r.innerHTML=role.value;
row.appendChild(c);
row.appendChild(n);
row.appendChild(r);
table.appendChild(row);
});
</script>
</body>
</html>