将匹配元素的集合减少到集合中的最后一个
xiyueta().last()属性方法,一种调用方式:
1、xiyueta("div").last(); //将匹配元素的集合减少到集合中的最后一个,等同于 .eq(-1)
总结:xiyueta().last()用法与jQuery中jQuery().last()用法保持一致
see https://api.jquery.com/last
尝试一下>>
<script src="https://www.xiyueta.com/js/xiyueta.min.js"></script> <script>
var html='<ul>\n\ <li>xiyueta<br>JS库<br></li>\n\ <li>QQ<br>313801120<br></li>\n\ <li>this is www.xiyueta.com<br>@<br></li>\n\ </ul>'; $().parse(html); $.log(xiyueta("li").last().text());
</script>
this is www.xiyueta.com@