[jQuery] Get the previous element matching a class

2010-03-02 Thread debussy007
Hi, I would like to have the previous TD element with class time. I tried : $(this).closest('td').prev('td.time').html() (where this is a div element inside a TD) But it only works for a div inside a TD that is *directly* following the td.time element. See the code below: my jquery

Re: [jQuery] Get the previous element matching a class

2010-03-02 Thread Nathan Klatt
On Tue, Mar 2, 2010 at 9:20 AM, debussy007 debussy...@gmail.com wrote: I would like to have the previous TD element with class time. I tried : $(this).closest('td').prev('td.time').html()   (where this is a div element inside a TD) But it only works for a div inside a TD that is *directly*