$("#recent_activity tbody tr td.date:first").text();
On Feb 12, 9:13 am, Mark Steudel <msteu...@gmail.com> wrote: > I have a table like so: > > <table id="recent_activity"> > <thead> > <tr> > <th>t1</th> > <th>t2</th> > </tr> > </thead> > <tbody> > <tr> > <td>value</td> > <td class="date">2008-09-01</td> <--- want this content > </tr> > <tr> > <td>value</td> > <td class="date">2008-09-01</td> > </tr> > </tbody> > </table> > > And I want to try and get the first td with class date, I've tried the > following and I get close, but I think I'm just missing something > easy: > > $('#recent_activity tbody:first-child .activity_date').val(); <-- > returns undefined > > or > > $('#recent_activity tbody:first-child .activity_date').html(); <-- > returns null > > Thoughts? Better way? > > Thanks