书名 价格
看得见风景的房间 ¥30.00
60个瞬间 ¥32.00
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function addRow() {
// 创建新节点
let newRow = $("<tr><td>幸福从天而降</td><td align='center'>&yen;18.50</td></tr>");
// 将节点添加到指定标签后
$("#row1").parent().append(newRow);
}

// 219971147朱良桂
function updateRow() {
// 获取标签后,设置css
$("#row1").css({"font-weight": "bold", "text-align": "center", "background-color": "#cccccc"});
}

function delRow() {
let dRow = document.getElementsByTagName("tr"); //访问被删除的行
if (dRow[2] != null) {
// 删除指定节点
dRow[2].remove();
}
}

function copyRow() {
// 获取table标签的所有子节点
let lastRow = $("#myTable tr:last-child");
// 克隆节点
let newRow = lastRow.clone();
// 将节点添加到指定标签之后
$("#myTable").append(newRow);
}