div隐藏和显示下一行

来源:互联网 发布:最好的打车软件 编辑:程序博客网 时间:2024/05/15 09:39

<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>