首页javascriptinputjQuery Selector - 如何按照名称在父元素中定位元素...

jQuery Selector - 如何按照名称在父元素中定位元素...

我们想知道如何按照名称在父元素中定位元素。...


<html>
  <head>
    <script type="text/javascript" src='http://code.jquery.com/jquery-1.5.2.js'></script>
    <script type="text/javascript">
    $(document).ready(function(){
        var input = $("form input:text");
        $("div").text("For this type jQuery found " + input.length + ".");
    });
    </script>
  </head>
  <body>
     <form>
      <input type="text" />
    </form>
     <div></div>
  </body>
</html>