<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<title>Tugas PWEB - jQuery</title>
</head>
<body>
<div class="container-fluid">
<center>
<h1>Latihan Jquery</h1>
<br>
<div class="container">
<div class = "form-group">
<label for = "book">Nama Buku :</label>
<input type="text" id = "txtNewBook" class="form-control"/>
</div>
<br>
<div class="form-group">
Semua Buku :
<select id = "DDLbook" class="form-control">
<option value="">Pilih</option>
</select>
</div>
<br>
<input type="button" id = "btnAdd" value="Tambah Buku" class = "btn btn-primary"/>
<script>
$(\'#btnAdd\').click(function(){
var newbook = $(\'#txtNewBook\').val();
$(\'#DDLbook\').append(new Option(newbook, newbook));
})
</script>
</div>
<br/>
<br/>
<br/>
<br/>
<a href="tugas2.php" class="btn btn-primary">Menuju Tugas ke 2</a>
</center>
</div>
</body>
</html>