代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>学生成绩信息</title>
</head>
<body>
<fieldset>
<legend>学生成绩信息</legend>
<p><input type="hidden" id="id"></p>
<p>学号:<input type="text" id="code"></p>
<p>姓名:<input type="text" id="name"></p>
<p>班级:<input type="text" id="clazz"></p>
<p>课程:<input type="text" id="course"></p>
<p>生日:<input type="text" id="birth"></p>
<p>成绩:<input type="text" id="grade"></p>
<button onclick="save()">保存</button>
</fieldset>
<button onclick="seach()">查询所有</button>
<table border="1" id="mytable">
<tr>
<td>学号</td>
<td>姓名</td>
<td>班级</td>
<td>课程</td>
<td>生日</td>
<td>成绩</td>
<td>操作</td>
</tr>
</table>
</body>
<script>
let dbReq;
// 加载时创建数据库和表
window.onload = function() {
console.log("加载完成!");
// 创建数据库
dbReq = indexedDB.open('sdb', 1);
dbReq.onupgradeneeded = function(e) {
// 获取数据库对象
let db = e.target.result;
// 创建对象仓库
let stores = db.createObjectStore("user", {
keyPath: "id",
autoIncrement: true
});
&n

最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



