在前台有这么一个东西,即一个checkbox,旁边是“评价”两个字。
     <td>
     <input type="checkbox" id="aa"/>评价
     </td>
     现在,我想要再后台的某个事件中,将checkbox与“评价”这两个字都隐藏了。checkbox可以解决,即
     this.aa.Visible=false;
     但是“评价”二字该如何隐藏呢?
          

解决方案 »

  1.   

    L@_@K
    <!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>
        <title>InsertDocumentTitle</title>
        <meta http-equiv="content-type" content="text/html;charset=utf-8">
        <meta name="generator" content="editplus" />
        <meta name="author" content="[email protected]" />
        <meta name="keywords" content="" />
        <meta name="description" content="" />
    </head><body>
        <table>
            <tr>
              <td>
              <input type="checkbox" id="aa"/>评价
              </td>
              <td>12</td>
            </tr>
            <tr>
              <td>21</td>
              <td>22</td>
            </tr>
        </table>
    </body>
    <script type="text/javascript">
    <!--
    //this.aa.parentNode.style.visibility = "hidden";
    // Or
    this.aa.parentNode.innerHTML = "";
    //-->
    </script>
    </html>
      

  2.   

    如果是服务器代码,就在“评价”二字放到一个Literal中
    如果是js代码,给td一个id,直接隐藏td,<td id='ttt'> 
    document.getElementById('ttt').style.display='none';
      

  3.   

      <td>
        <input type="checkbox" id="aa"/><div id="txtpj">评价</div>
      </td>
    document.getElementById("txtpj").style.display="none";
      

  4.   

    关系理顺既然 checkbox和 评价 是一伙的
    那么就放在一个容器里 然后控制容器的显示隐藏
    <div id='aa' >
    <input type="checkbox" />评价
    </div>