-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathform.html
More file actions
48 lines (47 loc) · 1.41 KB
/
form.html
File metadata and controls
48 lines (47 loc) · 1.41 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
.container {
padding: 50px;
}
</style>
</head>
<body>
<div class="container">
<h2>Natural language processing (Node.js based) - Search Word</h2>
<form class="mt-5">
<div class="form-group mb-3">
<label>Keyword</label>
<input type="text" class="form-control keyword-input" placeholder="e.g Egg" name="keyword">
</div>
<div class="form-group mb-3">
There are <span class="total-cnt"></span> <i class="keyword-str"></i> found.
</div>
<div class="d-grid mt-3">
<div class="btn btn-danger submit">Submit</div>
</div>
</form>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(".submit").click(function(){
$.post(
"/",
{
keyword: $(".keyword-input").val()
},
(data) => {
console.log("data: ", data);
$(".total-cnt").html(data.totalCnt);
$(".keyword-str").html(data.keyword);
});
});
});
</script>
</html>