-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
59 lines (51 loc) · 1.67 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>TRADEXA_internship</title>
<!-- importing stylesheet and script file -->
<link rel="stylesheet" href="style.css">
<script src="interact.js"></script>
</head>
<body>
<header>
<!-- add button placed on the top of the table -->
<div class="click" >
<img src="plus.png" alt="" id="plus">
<button id="btn" onclick="openform()" >ADD</button>
</div>
<!-- script that will open,close and reset a form when clicked on specific button-->
<script>
function openform() {
document.querySelector(".popup").style.display="flex";
}
function closeform(){
document.querySelector(".popup").style.display="none";
}
function reset(){
document.getElementById('title').value='';
document.getElementById('body').value='';
}
</script>
</header>
<!-- creating simple tabular format -->
<table class="tab">
<thead>
<tr>
<th>title</th>
<th>body</th>
</tr>
</thead>
<tbody id="data"></tbody>
</table>
<!-- created popup form view with basic input fields -->
<div class="popup" >
<div class="content" >
<input type="text" placeholder="Enter Title.." id="title">
<input type="text" placeholder="Enter Body.." id="body">
<button id="btnClose" onclick="post_data(), reset()">Submit</button>
<button id="btnClose" onclick="closeform()">Close</button>
</div>
</div>
</body>
</html>