L@_@K
<!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>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="Gao YiXiang" />
<meta name="email" content="[email protected]" />
<meta name="keywords" content="javascript dhtml dom" />
<meta name="description" content="I love web development." />
</head>
<body>
<table border="1">
<tr id="trFirst">
<td>r11</td>
<td>r12</td>
</tr>
<tr>
<td>r21</td>
<td>r22</td>
</tr>
<tr>
<td>r31</td>
<td>r32</td>
</tr>
</table>
<input type="button" id="btnHideFirst" value="Hidden first row" />
<script type="text/javascript">
<!--
var oBtn = document.getElementById("btnHideFirst");
oBtn.onclick = function()
{
var oTr = document.getElementById("trFirst");
if (oTr)
{
oTr.style.setAttribute("display", "none");
}
};
//-->
</script>
</body>
</html>
<!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>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="Gao YiXiang" />
<meta name="email" content="[email protected]" />
<meta name="keywords" content="javascript dhtml dom" />
<meta name="description" content="I love web development." />
</head>
<body>
<table border="1">
<tr id="trFirst">
<td>r11</td>
<td>r12</td>
</tr>
<tr>
<td>r21</td>
<td>r22</td>
</tr>
<tr>
<td>r31</td>
<td>r32</td>
</tr>
</table>
<input type="button" id="btnHideFirst" value="Hidden first row" />
<script type="text/javascript">
<!--
var oBtn = document.getElementById("btnHideFirst");
oBtn.onclick = function()
{
var oTr = document.getElementById("trFirst");
if (oTr)
{
oTr.style.setAttribute("display", "none");
}
};
//-->
</script>
</body>
</html>
http://download.csdn.net/source/308913样式表中文手册
http://download.csdn.net/source/304124JScript语言参考
http://download.csdn.net/source/308916
oTr.style.setAttribute("display", "none");
是正确的.