[jQuery] Re: Can i use selector to reach "slice" in jQuery 1.3?
Thanks Stephan and Ricardo. ^^
[jQuery] Re: Can i use selector to reach "slice" in jQuery 1.3?
It's much faster (and clearer) to use slice(): $('.button').slice(1,3); On Feb 5, 12:56 pm, Stephan Veigl 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 : > > > > > I remember i can use the statement "jQuery('.button:eq(1):lt(3)');" in > > jQuery 1.2.6. > > example: > > > > > > button1 > > button2 > > button3 > > button4 > > button5 > > > > > > 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??
[jQuery] Re: Can i use selector to reach "slice" in jQuery 1.3?
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 : > > I remember i can use the statement "jQuery('.button:eq(1):lt(3)');" in > jQuery 1.2.6. > example: > > > button1 > button2 > button3 > button4 > button5 > > > 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?? >