Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: JQuery:如何从表中选择行
我是 jQuery 的初学者。我有一个包含多行的表,在选择特定行后如何选择下一行或上一行?
对于下一行(假设 myRow 是您选择的行元素):
$(myRow).next();
我建议使用非常强大的选择器语法,而不是根据当前选择的元素实例选择上一个和下一个元素,但是:
http://docs.jquery.com/Selectors
$(this).next();
或者
$(this).prev();