Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
156
rated 0 times [  160] [ 4]  / answers: 1 / hits: 29308  / 13 Years ago, wed, august 24, 2011, 12:00:00

I have an element we'll call selectedTable that contains this innerHtml:



<TBODY>
<TR>
<TD></TD>
<TD></TD>
<TD class='ms-cal-nav-buttonsltr'></TD>
</TR>
</TBODY>


I'm trying to use JQuery selectors to return the <TD> tag with the ms-cal-nav-buttonsltr class. I've found that $(selectedTable).find(TD) returns all the TD tags in the table as expected, but I'm wondering how I might go about combining the TD element selector with a class selector. I've tried $(subnode).find(TD).find(.ms-cal-nav-buttonsltr) and $(subnode).find(TD .ms-cal-nav-buttonsltr) to no avail, but those were just shots in the dark. What's the most efficient way to accomplish this? Thanks in advance.


More From » jquery

 Answers
42

Just concatenate the two:



$(selectedTable).find(td.ms-cal-nav-buttonsltr);


the selectors you tried were looking for a .ms-cal-nav-buttonsltr element underneath the td.


[#90436] Tuesday, August 23, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
cristopherh

Total Points: 402
Total Questions: 117
Total Answers: 84

Location: Monaco
Member since Fri, Sep 24, 2021
3 Years ago
;