-

xiyueta().length 对象属性

当前匹配的元素数量
快速上手

xiyueta().length对象属性,一种调用方式:
1、xiyueta("div").length; //当前匹配的元素数

总结:xiyueta().length用法与jQuery中jQuery.length用法保持一致
see https://api.jquery.com/length
尝试一下>>

  • 代码
  • 效果
<script src="https://www.xiyueta.com/js/xiyueta.min.js"></script>
<script>var html='<ul><li>11<br>22<br></li><li>aa<br>bb<br></li></ul>';
 
$().parse(html);
$.log($("li").length);
</script>
2