[ jquery 选择器 :gt(index) ] 此方法选取匹配大于指定索引值的所有元素

此方法选取匹配大于指定索引值的所有元素:角标值从0开始计数

<!DOCTYPE html>
<html lang='zh-cn'>
<head>
<title>Insert you title</title>
<meta http-equiv='description' content='this is my page'>
<meta http-equiv='keywords' content='keyword1,keyword2,keyword3'>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type='text/javascript' src='./js/jquery-1.12.1.min.js'></script>
<script type='text/javascript'>
    $(function(){
       var size = $('#list li:gt(3)').size();
       alert(size);
    });    
</script>
</head>
<body>
    <ul id='list'>
        <li></li>
        <li class='eq-selector'></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
</body>
</html>

 

posted @ 2016-06-22 07:18  窗棂  Views(3184)  Comments(0Edit  收藏  举报