复选框实现多行的显示和隐藏

yibin 2015-02-09 建站源码 563


    <!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=gb2312" />
    <title>ASP急救中心-www.ccap168.cn</title>
    <script language="javascript">
    function Check(obj)
    {
    var type = obj.value;
    if(type ==1)
    {
    this.document.all("xms1")。style.display = "none";
    this.document.all("xms2")。style.display = "none";
    this.document.all("xms3")。style.display = "block";
    this.document.all("xms4")。style.display = "block";
    this.document.all("xms5")。style.display = "block";
    this.document.all("xms6")。style.display = "block";
    this.document.all("xms7")。style.display = "block";
    }
    else if(type == 2)
    {
    this.document.all("xms1")。style.display = "block";
    this.document.all("xms2")。style.display = "block";
    this.document.all("xms3")。style.display = "none";
    this.document.all("xms4")。style.display = "none";
    this.document.all("xms5")。style.display = "none";
    this.document.all("xms6")。style.display = "none";
    this.document.all("xms7")。style.display = "none";
    }
    document.all("txtSelect")。value = obj.value;
    //alert(obj.value);
    }
    </script>
    </head>
    <body>
    <table width="100%" border="1" cellspacing="0" cellpadding="0">
    <tr>
    <td width="9%"> </td>
    <td width="91%"><input type="radio" onclick="Check(this)" name="dlm" id="radio" value="1" />b <input type="radio" onclick="Check(this)" name="dlm" id="radio" value="2" />a</td>
    </tr>
    <tr style="display:none;" id='xms1'>
    <td> </td>
    <td>1www.lvmanba.com</td>
    </tr>
    <tr style="display:none;" id='xms2'>
    <td> </td>
    <td>2www.lvmanba.com</td>
    </tr>
    <tr style="display:none;" id='xms3'>
    <td> </td>
    <td>3www.lvmanba.com</td>
    </tr>
    <tr style="display:none;" id='xms4'>
    <td> </td>
    <td>4www.lvmanba.com</td>
    </tr>
    <tr style="display:none;" id='xms5'>
    <td> </td>
    <td>5www.lvmanba.com</td>
    </tr>
    </table>
    </body>
    </html>

扫码添加微信

13013082126 扫描微信 建站咨询 优化咨询