• 0

[jQuery] .find with multiple results.


Question

var colspanstart = $(rowID).find("td[colspan]").attr("class");

 

The above works but it only lets me manage the first element it finds matching that criteria on the row.

 

If there are multiple colspans on that row, how would I select the second or third one for example?

 

Many thanks.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I prefer to use "rowID" as a selector constraint.

 

$('td[colspan]', rowID)

 

Then you can use the ":eq()" filter in your selector if you really only want the second or third td.

 

$('td[colspan]:eq(2)', rowId)
Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.