[jquery filter Slice (start, [end])] This method is used to precisely filter out a subset of matches on top of the selector (you can use a leading limit range)

Source: Internet
Author: User

This method is used to precisely filter out a matching subset on top of the selector (you can use a leading limit range):

1.start: the position at which to start selecting a subset. The first element is 0. If it is a negative number, you can select it from the tail of the collection

2.end: end Pick Your own position, if not specified, it is the end of itself

3. The parameter contains the start, does not contain the end [start, end]

Instance:

<! DOCTYPE html>    $(function(){        $(' Li '). each (function(Index) {$ ( This). HTML (index);        }); varArr = $ (' li '). Slice (2,7);//This method contains the start but not the end, and the corner label is calculated from 0         for(vari=0; i<arr.length;i++){           //Console.log (arr[i].innerhtml);Console.log (Arr[i]); }    });</script>

[jquery filter Slice (start, [end])] This method is used to precisely filter out a subset of matches on top of the selector (you can use a leading limit range)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.