定义一个函数吧
function Display(tmp){
document.getElementById(tmp).style.display = "";
...
}

解决方案 »

  1.   

    <HTML>
    <HEAD>
    <TITLE></TITLE>
    <SCRIPT>
    var objFocus=null;
    function showTb(strObj){
    var el=document.getElementById(strObj);
    el.style.display="";
    if (objFocus!=null) objFocus.style.display="none";
    objFocus=el;
    }
    </SCRIPT>
    </HEAD>
    <BODY><input type="radio" name="radiobutton" value="radiobutton" onClick="showTb('tb1')">
    <input type="radio" name="radiobutton" value="radiobutton" onClick="showTb('tb2')">
    <input type="radio" name="radiobutton" value="radiobutton" onClick="showTb('tb3')">
    <input type="radio" name="radiobutton" value="radiobutton" onClick="showTb('tb4')">
    <input type="radio" name="radiobutton" value="radiobutton" onClick="showTb('tb5')">
    <input type="radio" name="radiobutton" value="radiobutton" onClick="showTb('tb6')"><table width="200" border="1" id="tb1" style="display:none">
      <tr>
        <td>Table1</td>
      </tr>
    </table>
    <table width="200" border="1" id="tb2" style="display:none">
      <tr>
        <td>Table2</td>
      </tr>
    </table>
    <table width="200" border="1" id="tb3" style="display:none">
      <tr>
        <td>Table3</td>
      </tr>
    </table>
    <table width="200" border="1" id="tb4" style="display:none">
      <tr>
        <td>Table4</td>
      </tr>
    </table>
    <table width="200" border="1" id="tb5" style="display:none">
      <tr>
        <td>Table5</td>
      </tr>
    </table>
    <table width="200" border="1" id="tb6" style="display:none">
      <tr>
        <td>Table6</td>
      </tr>
    </table>
    </BODY>
    </HTML>
      

  2.   

    谢谢 rawjim 我刚才出去开会啦
    你真是太好了
    感激
    让我试一试哈
      

  3.   

    rawjim你还在不在呢??
    问题解决了一部分现在还存在的问题:
    就是我有一排三个按钮,我点击任何一个按钮就会展开相应的table,当我点击同一排其他的按钮时候就不要合上了,而是保持打开状态,当我点击另一排的时候再打开新的一排的table而关闭刚才的那一排。
    不知道我叙述的清楚不,您还在的话就麻烦您了,谢谢啦~
      

  4.   

    <HTML>
    <HEAD>
    <TITLE></TITLE>
    <SCRIPT>
    var objFocus=null;
    function showTb(strObj){
    var el=document.getElementById(strObj);
    if (el != objFocus){
    el.style.display="";
    if (objFocus!=null) objFocus.style.display="none";
    objFocus=el;
    }
    }
    </SCRIPT>
    </HEAD>
    <BODY>
    <input type="button" value="1-1" onclick="showTb('tb1')">
    <input type="button" value="1-2" onclick="showTb('tb1')">
    <input type="button" value="1-3" onclick="showTb('tb1')"><br><br><input type="button" value="2-1" onclick="showTb('tb2')">
    <input type="button" value="2-2" onclick="showTb('tb2')">
    <input type="button" value="2-3" onclick="showTb('tb2')"><br><br><input type="button" value="3-1" onclick="showTb('tb3')">
    <input type="button" value="3-2" onclick="showTb('tb3')">
    <input type="button" value="3-3" onclick="showTb('tb3')"><table width="200" border="1" id="tb1" style="display:none">
      <tr>
        <td>Table1</td>
      </tr>
    </table>
    <table width="200" border="1" id="tb2" style="display:none">
      <tr>
        <td>Table2</td>
      </tr>
    </table>
    <table width="200" border="1" id="tb3" style="display:none">
      <tr>
        <td>Table3</td>
      </tr>
    </table>
    </BODY>
    </HTML>
      

  5.   

    真是遇到了js的强人了,我的天啊,我真佩服 rawjim ,人也热心,真的是感激~~
    我结贴了, rawjim 祝你好运~~                                        ------我在进步 因为有你们