使用bootstrap+jQuery实现简单的学生管理系统增删改查功能
warning:
这篇文章距离上次修改已过204天,其中的内容可能已经有所变动。
以下是一个简单的学生管理系统示例,使用了Bootstrap和jQuery来增强用户界面和简化JavaScript代码。
HTML 部分:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>学生管理系统</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="app.js"></script>
</head>
<body>
<div class="container mt-4">
<button class="btn btn-success" id="addStudentBtn">添加学生</button>
<table class="table mt-4" id="studentsTable">
<thead>
<tr>
<th>ID</th>
<th>姓名</th>
<th>年龄</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<!-- 学生数据将会被插入这里 -->
</tbody>
</table>
</div>
<!-- 添加学生的模态框 -->
<div class="modal fade" id="addStudentModal" tabindex="-1" role="dialog" aria-labelledby="addStudentLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addStudentLabel">添加学生</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="studentName">姓名</label>
<input type="text" class="form-control" id="studentName" placeholder="学生姓名">
</div>
<div class="form-group">
<label for="studentAge">年龄</label>
<input type="number" class="form-control" id="studentAge" placeholder="学生年龄">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-
评论已关闭