您的位置:首页 > Web前端 > JavaScript

div隐藏和显示下一行

2007-10-14 20:57 295 查看
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
<SCRIPT language="javascript">
function Display(obj)
{

sid=obj.parentNode.parentNode.parentNode.childNodes[1];
if (sid.style.display == "none")
{
sid.style.display="";
obj.innerText="-";
}else{
sid.style.display="none";
obj.innerText="+";
}

}
</SCRIPT>
</head>
<body>

    <form id="form1" runat="server">
    <table border=1>
    <tr>
    <td><div onclick="Display(this)">+</div></td>
    </tr>
    <tr>
    <td>45454545</td>
    </tr>
    </table>
    </form>
</body>
</html> 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息