The jQuery UI method of .slice() allows you to select a set number of items from the set of matched elements for manipulation. You specify at which point to start in the list of items and at which point to stop manipulation.

An example would be that you have a list of items and you wish to highlight a set number of those items at a certain point.

What you put for the parameters in the .slice() parenthesesa are index number of the first item to be affected and the index number of the first item that will stop being affected. If you just put in one number for the parameter, all items after that will be affected.

Remember that the list of any items is essentially an array, and the first item has the index of [0].

Here is an example of usinge the .slice() method:

   $("#myList li").slice(1, 3).css("color","red");

<ol id="myList">
    <li>Van Gogh</li>
<p>Click here to change Color</p>

Following is the result. Note that by specifying .slice(1, 3) how the manipulation starts at index [1] which is the second item. The manipulation stops at index [3], which is the fourth item.