美文网首页SAP
jQuery find 和 filter 方法的区别

jQuery find 和 filter 方法的区别

作者: _扫地僧_ | 来源:发表于2021-12-22 09:30 被阅读0次

    源代码:

    <!DOCTYPE html>
    <html>
    <head>
        </script>
    </head>
    <body class="jchartfx_body">
    <div>
      <input type="radio" disabled id="html" name="fav_language" value="HTML">
      <label for="html">HTML</label><br>
      <input type="radio" id="css" name="fav_language" value="CSS">
      <label for="css">CSS</label><br>
      <button class="btn-primary">Click Me</button>
      <button class="btn btn-block btn-primary" disabled>Click Me 2</button>
    </div>
        <script language="javascript">
            $(document).ready(function ($) {
                var temp = $("button");
    
                var filter = temp.filter(".btn.btn-block.btn-primary");
                var find = temp.find(".btn.btn-block.btn-primary");
                debugger;
            });
        </script>
        </div>
    </div>
    </body>
    </html>
    
    

    filter:


    find:找不到数据:

    更多Jerry的原创文章,尽在:"汪子熙":


    相关文章

      网友评论

        本文标题:jQuery find 和 filter 方法的区别

        本文链接:https://www.haomeiwen.com/subject/udelxrtx.html