x
1
2
<html>
3
<head>
4
<meta charset="utf-8">
5
<title>蜜蜂教程(mifengjc.com)</title>
6
<script>
7
function changeContent() {
8
var x = document.getElementById('myTable').rows[0].cells;
9
x[0].innerHTML = "新内容";
10
}
11
</script>
12
</head>
13
<body>
14
15
<table id="myTable" border="1">
16
<tr>
17
<td>行1 列1</td>
18
<td>行1 列2</td>
19
</tr>
20
<tr>
21
<td>行2 列1</td>
22
<td>行2 列2</td>
23
</tr>
24
<tr>
25
<td>行3 列1</td>
26
<td>行3 列2</td>
27
</tr>
28
</table>
29
<form>
30
<input type="button" onclick="changeContent()" value="修改内容">
31
</form>
32
33
</body>
34
</html>