var allInputs = $(":input");

解决方案 »

  1.   

    jquery有一种方法.取得所有表单控件
      

  2.   

    匹配所有 input, textarea, select 和 button 元素
      

  3.   

    :表示 是什么的
    [] 表示 有什么的 
    比如 $("tr:first") 表是tr是first的那些
    $(":input") 是input的那些
    $("div[id]") 表是有id属性的div
      

  4.   


    <!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=utf-8" />
    <title>test</title>
    <script src="jquery-1.3.2.js"></script>
    <script>
    $('document').ready(function(){
      $(':input').click(function(){
    alert($(this).attr("name"));
      })
    });
    </script>
    </head><body>
    <input type="text" name="text"/>
    <input type="checkbox" name="checkbox" />
    <input type="button" value="hidden" name="button" />
    </body>
    </html>所有匹配input的标签
      

  5.   

    $(":input");这个是jquery的筛选语法,
    得到所有的 <input .../>的元素的jquery对象数组的集合。
      

  6.   

    jquery选择器语法,可在线查看API  http://jquery-api-zh-cn.googlecode.com/svn/trunk/index.html