SAP

jQuery find 和 filter 方法的区别

2021-12-22  本文已影响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的原创文章,尽在:"汪子熙":


上一篇下一篇

猜你喜欢

热点阅读