首页javascriptselectorjQuery Form - 如何查找具有id属性的所有输入,其name属性以m结尾

jQuery Form - 如何查找具有id属性的所有输入,其name属性以m结尾

我们想知道如何查找具有id属性的所有输入,其name属性以m结尾。


<html>
  <head>
    <script type="text/javascript" src='http://code.jquery.com/jquery-1.5.2.js'></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $("input[id][name$='m']").val("asdf");
        });
    </script>
  </head>
  <body>
      <input id="a" name="m" />
  </body>
</html>