Html代码
- 总结一下 html中的隐藏tr的 javascript 方法
- -----------------------源码 -----------------------------------
- <html>
- <head>
- <title>点击checkbox 隐藏 展现 某行</title>
- <script>
- function changeOracle(){
- document.getElementById("oracle1").style.display = (document.getElementById("oracle1").style.display=="")?"none":"";
- document.getElementById("oracle2").style.display = (document.getElementById("oracle2").style.display=="")?"none":"";
- }
- </script>
- </head>
- <body>
- <table>
- <tr>
- <td >
- 是否安装Oracle服务器:
- </td>
- <td>
- <input type="checkbox" id="oracle" name="oracle" value="1" onclick="changeOracle();" />
-
- </td>
- <td ></td>
- <td ></td>
- </tr>
- <tr id="oracle1" style="display:none;">
- <td >
- Oracle用户名:
- </td>
- <td >
- <input type = "text" name = "oracleUsername"/>
- </td>
- <td>
- Oracle密码:
- </td>
- <td >
- <input type = "text" name = "oraclePassword"/>
- </td>
- </tr>
- <tr id="oracle2" style="display:none;">
- <td>
- Oracle全局数据库名:
- </td>
- <td >
- <input type = "text" name = "oracleDbName"/>
- </td>
- <td ></td>
- <td ></td>
- </tr>
- </table>
- </body>
- </html>