将一组匹配元素减少到指定索引处的元素
xiyueta().eq()属性方法,一种调用方式:
1、xiyueta("div").eq(-1); //将一组匹配元素减少到指定索引处的元素 -1为最后一位
总结:xiyueta().eq()用法与jQuery中jQuery().eq()用法保持一致
see https://api.jquery.com/eq
尝试一下>>
<script src="https://www.xiyueta.com/js/xiyueta.min.js"></script> <script>
var html='<ul>\n\ <li>11<br>xiyueta<br></li>\n\ <li>aa<br>xiyuetaJS库<br></li>\n\ <li>this is yun<br>@<br></li>\n\ </ul>'; xiyueta().parse(html); $.log(xiyueta("li").eq(-1).text());
</script>
this is yun@