Is there a better way to select tables based on how many rows they have via jQuery?

Posted by bubbahotep on Stack Overflow See other posts from Stack Overflow or by bubbahotep
Published on 2010-06-12T23:52:54Z Indexed on 2010/06/13 0:02 UTC
Read the original article Hit count: 104

I'm looking to grab a group of tables that have more than X rows with jQuery. Currently, I'm doing something similar to:

    $("table").each(function(){
 if($(this).find("tr").length > x){
  tableArray[tableArray.length] = $(this);
 }
});

and then acting on the members of the tableArray.

Is there a better way of getting these tables, perhaps a nice selector I've missed?

Thanks

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery