-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
62 lines (49 loc) · 2.1 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
60
61
62
<!doctype html>
<html lang="en">
<head>
<title>JavaScript XHR using JSONPlaceholder API</title>
<!-- meta -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- css -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
</head>
<body class="bg-light">
<div class="container my-5">
<div class="row">
<div class="col">
<h3>JavaScript XHR using JSONPlaceholder API</h3>
<hr>
<!-- add new post -->
<button id="btnAdd" type="button" class="btn btn-primary btn-sm float-right">
<i class="fa fa-plus pr-1"></i>Add
</button>
<h5 class="mb-3">Posts</h5>
<!-- alert messages -->
<div id="dvMessage" class="alert d-none" role="alert"></div>
<!-- post form -->
<form id="frmPost" class="card mb-3 d-none">
<div class="card-body">
<h5 id="frmTitle" class="card-title">Add Post</h5>
<div class="form-group">
<input type="text" name="txtTitle" id="txtTitle" class="form-control" placeholder="Enter title">
</div>
<div class="form-group">
<textarea rows="3" name="txtBody" id="txtBody" class="form-control"
placeholder="Enter body"></textarea>
</div>
<button id="btnSubmit" type="submit" class="btn btn-primary">Submit</button>
<button type="reset" class="btn btn-secondary">Reset</button>
<button id="btnCancel" type="button" class="btn btn-light">Cancel</button>
</div>
</form>
</div>
</div>
<!-- post list -->
<div id="dvList" class="row"></div>
</div>
<!-- js -->
<script src="js/index.js"></script>
</body>
</html>