<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function a()
{
var rows=document.getElementById('TTT').rows.length;
for(i=0;i<rows;i++)
{
alert(alert(document.getElementById('TTT').rows[i].cells[1].innerText););
}
}
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<label>
<input type="button" name="button" id="button" value="Button" οnclick="javascript:a();"/>
</label>
<table width="98%" border="1" id="TTT">
<tr>
<td> </td>
<td>a</td>
</tr>
</table>
</form>
</body>
</html>
//删除行/
<script>
function del(obj)
{
obj.parentNode.parentNode.removeNode(true);
}
</script>
<body>
<table>
<tr><td>单元格1</td><td><input type=button value="delete this row" οnclick="del(this)"></td></tr>
</table>
</body>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function a()
{
var rows=document.getElementById('TTT').rows.length;
for(i=0;i<rows;i++)
{
alert(alert(document.getElementById('TTT').rows[i].cells[1].innerText););
}
}
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<label>
<input type="button" name="button" id="button" value="Button" οnclick="javascript:a();"/>
</label>
<table width="98%" border="1" id="TTT">
<tr>
<td> </td>
<td>a</td>
</tr>
</table>
</form>
</body>
</html>
//删除行/
<script>
function del(obj)
{
obj.parentNode.parentNode.removeNode(true);
}
</script>
<body>
<table>
<tr><td>单元格1</td><td><input type=button value="delete this row" οnclick="del(this)"></td></tr>
</table>
</body>