chào mọi người hiện em có bài tập là tạo giao diện quản lí sinh viên với framework nhưng đến đoạn tạo nút tìm kiếm một phần tử thì e không biết như nào mọi người góp ý giúp e với được không ạ. em cảm ơn ạ!
<body>
<div class='container'>
<div class='form-group'>
<label for='msv'>Mã sinh viên
<input type='text' class='msv' id='msv'>
<p style="color:red;display:inline">(*)</p></label><br>
<label for='hvt'>Họ và tên
<input type='text' class='hvt' id='hvt'>
<p style="color:red;display:inline">(*)</p></label><br>
<label for='age'>Tuổi
<input type='number' class='age' id='age'>
<p style="color:red;display:inline">(*)</p></label><br>
<label for='lop'>Lớp
<input type='text' class='lop' id='lop'>
<p style="color:red;display:inline">(*)</p></label><br>
</div>
<div class="but">
<button class='btn btn-primary'>Thêm mới</button>
</div><br>
<table class="table table-bordered">
<thead>
<tr>
<th>STT</th>
<th>Họ và tên</th>
<th>Mã sinh viên</th>
<th>Tuổi</th>
<th>Giới tính</th>
<th>Ngày sinh</th>
<th>Lớp</th>
</tr>
</thead>
<tbody id='tbthongtin'>
</tbody>
</table>
<div class="form-group">
<label for='msv'>Mã sinh viên
<input type='text' class='msv' id='msv'>
</label>
<label for='hvt'>Họ và tên
<input type='text' class='hvt' id='hvt'>
</label>
</div>
<div class="but">
<button class="btn btn-danger">Tìm kiếm</button>
</div>
<table class="table table-bordered">
<thead>
</thead>
<tbody class='timkiem'>
</tbody>
</table>
</div>
<script>
$(document).ready(function (){
var i =0;
$('.btn-primary').click(function (){
var hvt = $('#hvt').val();
var msv = $('#msv').val();
var age = $('#age').val();
var lop = $('#lop').val();
if (hvt ==='' || age =='' || lop =='' || msv =='') {
alert('Điền thông tin sinh viên')
}
else {
++i;
$('#tbthongtin').append('<tr><td>' + i + '</td><td>' + hvt + '</td><td>' + msv + '</td><td>' + age + '</td><td>giới tính</td><td> ngày sinh </td><td>' + lop + '</td></tr>');
$('#hvt').val('');
$('#msv').val('');
$('#age').val('');
$('#lop').val('');
}
$('.btn-danger').click(function(){
});
});
});
</script>
</body>