If i understand you correctly you can associate a click event to the table, then get the id of the TR clicked, then filter by nextAll('tr[id^=act+"id - top"].toggle(); something like: $('yourtable').click(function(e){ var id = $(e.target).closest('tr').attr('id'); // Then filter nextAll tr with id });
bryan rasmussen wrote: > > > Hi, > > I have a situation where a user clicks on something in a particular > table row which should cause all following rows in that table that > have a particular format of id to toggle visibility.. so for example > > <tr id="top11_21"><td> # click here </ > td>...rest of row data</td></tr> > <tr id="act11_21_1"><td>...</td></tr> > <tr id="act11_21_2"><td>...</td></tr> > ................ > <tr id="act11_21_30"><td>...</td></tr> > <tr id="top11_22"><td> # click here </ > td>...rest of row data</td></tr> > > when someone clicks on top11_21click it should toggle the visibility > of rows act11_21_1 to act11_21_30 > I would like to have this efficient, thus not just a find or filter, > but rather something that gets the context of the clicked row and then > loops following rows until the input does not match - any suggestions > for a jquery like way of handling this? > > -- View this message in context: http://www.nabble.com/Get-following-rows-in-a-table-until-id-not-match-certain-pattern-tp24519653s27240p24522639.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.