Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <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"
- integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
- <title>Book List</title>
- <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
- </head>
- <body>
- <div class="container">
- <div class="row justify-content-center py-5">
- <div class="col-md-5">
- <div class="card">
- <div class="card-header">
- <h5 class="text-left">Book List</h5>
- </div>
- <div class="card-body">
- <form>
- <div class="mb-3">
- <label for="newBookTitle" class="form-label">New Book Title</label>
- <input type="text" class="form-control" id=txtNewBook aria-describedby="newBookHelp">
- </div>
- <div class="mb-3">
- <label for="allBooks" class="form-label">ALL Books</label>
- <select type="" class="form-control" id="ALLbook">
- <option value=""></option>
- </select>
- </div>
- <button type="button" class="btn btn-primary" id="btnAdd">Add</button>
- <script>
- $('#btnAdd').click(function()
- {
- var newbook = $('#txtNewBook').val();
- $('#ALLbook').append(new Option(newbook, newbook));
- });
- </script>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement