This might help a bit (not tested): jQuery("tr.Grid_Item,tr.Grid_AltItem").each( function() { // Use tr to skip checking nont-tr-elements var td_nodes = jQuery(this).find('td'); // Get the td nodes with a single select and store them in a variable
var Id = td_nodes.eq(2).text(); var foo = td_nodes.eq(8).firstchild.attr("value"); var bar = td_nodes.eq(9).firstchild.attr("value"); }); There are other ways to optimize things but for further advice more info would be needed on what you are actually trying to accomplish. Looping over thousands of rows and dynamically fetching data is bound to be a bit slow, as DOM-access always has it's overhead. There are other more efficient ways to accomplish the same things, usually (such as storing all the necessary data in a javascript-object which gets updated when the values change. You can get _much_ faster response from getting / calculating the values from there when you need them, instead of looping all over the DOM every time).