Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I select all <th> elements of class "sortasc" within a table with a specific id?

Let's say I have the following HTML:

<table id="foo">
  <th class="sortasc">Header</th>
</table>

<table id="bar">
  <th class="sortasc">Header</th>
</table>

I know that I can do the following to get all of the th elements that have class="sortasc"

$$('th.sortasc').each()

However that gives me the th elements from both table foo and table bar.

How can I tell it to give me just the th elements from table foo?

like image 799
Mark Biek Avatar asked Sep 15 '25 18:09

Mark Biek


1 Answers

table#foo th.sortasc

like image 94
Fuzzy76 Avatar answered Sep 17 '25 08:09

Fuzzy76