.next() and .prev() only work with the next (or previous) /immediate/ element. In your example, the next element is actually a <br/> - which your filter doesn't match.
Currently there isn't a way to do what you want (easily) in jQuery. I'd imagine it being something like .nextClosest("div.myDiv"). The next best thing that I can think of would be to do: $(this).next().next("div.myDiv") Hope that helps. --John On 3/18/07, EvanT <[EMAIL PROTECTED]> wrote: > > Hi all, > > I've come across what is possibly a bug (or unexpected behaviour) when using > next(). > > I have an example page setup here: http://fapdragon.com/test/test.html > > As far as I can see, the filter for next() is not being applied and it > always returns the next DOM element. > > Can anyone comment on this or should I log a ticket for it? > > Thanks, > Evan > -- > View this message in context: > http://www.nabble.com/Possible-next%28%29-prev%28%29-bug--tf3422183.html#a9538163 > Sent from the JQuery mailing list archive at Nabble.com. > > > _______________________________________________ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/