I am a beginner in jQuery. I have a table with multiple rows, how do I select next row or previous row after selecting a particlar row?
+1
A:
For the next row (assuming myRow is your selected row element):
$(myRow).next();
I'd recommend using the very powerful selector syntax, instead of selecting previous and next elements based on currently selected element instances, however:
Gurdas Nijor
2009-10-14 05:53:30
Preetham
2009-10-14 06:13:04
A:
I am selecting a row using "onclick" event and changing its class name to "xyz". now I want the next row to the row with classname "xyz".
I have used $(".xyz").next() & $(".xyz").prev(), but the result set is empty.
Preetham
2009-10-14 06:04:42
Preetham, once you've asked the question, you should comment on other replies instead of answering your own question.
Gurdas Nijor
2009-10-14 06:11:32
Are you setting the "onclick" event for the button within the $(document).ready(); handler?
Gurdas Nijor
2009-10-14 06:14:00