It's much faster (and clearer) to use slice():
$('.button').slice(1,3);
On Feb 5, 12:56 pm, Stephan Veigl <[email protected]> wrote:
> Hi
>
> that selector works just as it should. If you get other results in
> JQuery 1.2.6, then there was a bug in 1.2.6.
> What you ask for is:
> 1. give me every element of class = "button" {'.button'} ==> "button1,...5"
> 2. give me the element with index 1 = second element {:eq(1)} ==> "button2"
> 3. give me only the first 3 elements in the remaining selection
> {:lt(3)} ==> "button2"
>
> what you described would be
> jQuery('.button:gt(1):lt(3)')
>
> by(e)
> Stephan
>
> 2009/2/5 Jackal <[email protected]>:
>
>
>
> > I remember i can use the statement "jQuery('.button:eq(1):lt(3)');" in
> > jQuery 1.2.6.
> > example:
> > <html>
> > <body>
> > <a href="#" class="button">button1</a>
> > <a href="#" class="button">button2</a>
> > <a href="#" class="button">button3</a>
> > <a href="#" class="button">button4</a>
> > <a href="#" class="button">button5</a>
> > </body>
> > <html>
> > It returned matched button results from button2 to button4.
>
> > But now it only returned button2 element in jQuery 1.3.
> > So the selector statement like this can't chain filters??