> If p < 5 and p > 3, isn't p = 4?
>
> $("p:eq(4)")  :)
>
> Otherwise, Klaus's option works:
>
> $("p:lt(5)").filter(":gt(3)")

See, there's something of an issue surrounding this, though. I haven't
decided if its a bug yet, or not. For example, assume the list:

1 2 3 4 5 6 7 8

doing :lt(5) gives you
1 2 3 4
then doing :gt(3) gives you
4

However, doing :gt(3) first, gives you:
4 5 6 7 8
then doing :lt(5) gives you
4 5 6 7

The order is definitely important. Every time you do a "filter" (like
eq or lt) it prunes the list down so all future operations must be
relative to the previous operations (If that makes any sense).

Additionally, I just recently added shortcut methods for eq/lt/gt so you can do:

$("p").lt(5).gt(3)

--John

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to