-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbonus.html
More file actions
75 lines (57 loc) · 1.75 KB
/
bonus.html
File metadata and controls
75 lines (57 loc) · 1.75 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
</head>
<body>
<div class="wrapper container">
<header class="mt-5 text-center">
<h1>Movies</h1>
</header>
<main>
<table>
<thead>
<tr>
<th>TITLE</th>
</tr>
</thead>
<tbody>
<tr>
<td>Shine</td>
</tr>
<tr>
<td>Real Genius</td>
</tr>
</tbody>
</table>
</main>
<hr>
<section>
<label for="title-input">Title</label>
<input id="title-input" type="text" name="title" placeholder="Enter title">
<button id="add-movie-btn">Add Movie</button>
</section>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"
integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN"
crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
<script>
"use strict";
function generateHTML(title) {
console.log(title)
return `<tr>
<td>${title}</td>
</tr>`;
}
$('#add-movie-btn').on('click', function () {
const title = $('#title-input').val();
$('tbody').append(generateHTML(title));
});
</script>
</body>
</html>