table id为“aaa”。那如题的要求该怎么写,谢谢大侠帮忙解决

解决方案 »

  1.   

    $("table #aaa")
    详情参照http://jquery-api-zh-cn.googlecode.com/svn/trunk/index.html检索器
      

  2.   

    那怎么获取该table下类型为text的input对象呢?
      

  3.   

    $("#aaa input[type='text']")
    没看清题目
      

  4.   

    感谢,我先去试试。prototype是这样用的的,还以为jquery不是这样用的呢
      

  5.   

    小狼:
    $("#aaa input[type='text']").each(function(i){
        alert(this.value); this.value = "";
     });
    我想把这些类型为text的input值全部清除,这样写可以吗?指点一下,谢谢
      

  6.   

    $("input[type='text']", $("#aaa"))
      

  7.   


    <!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> new document </title>
      <script type="text/javascript" src="jquery-1.3.2.js"></script>
     </head>
     <body>
      <table id="aaa">
    <tr>
    <td><input type="text" size="20" /></td>
    <td><input type="text" size="20" /></td>
    <td><input type="text" size="20" /></td>
    </tr>
    <tr>
    <td><input type="text" size="20" /></td>
    <td><input type="text" size="20" /></td>
    <td><input type="text" size="20" /></td>
    </tr>
      </table>
      <input type="text" size="20" />
      <input type="text" size="20" />
    <script type="text/javascript">
    <!--
    alert($("input[type='text']", $("#aaa")).length);
    $("input[type='text']", $("#aaa")).css("background-color","#F00");
    //-->
    </script>
     </body>
    </html>
      

  8.   

    $("#aaa :text").val("");
    就行了.
      

  9.   

    你这样就把aaa里所有的text checkbox file button...全都搞一遍了...
      

  10.   


    抱歉没注意到类型为text
    那这样好了$("#aaa~input[type='text']")