[英]How to access the upper and lower element of a given element in jquery
I have some div elements in a sequence, like : 我在序列中有一些div元素,例如:
<div id="a"></div>
<div id="b"></div>
<div id="c"></div>
<div id="d"></div>
Suppose i have id of 3rd position div which is c
. 假设我的id为3rd div,即
c
。 Now i want to access the div element which placed just above and below ( in this case b & d respectively ) of div whose id is c
. 现在,我要访问div元素,它位于id为
c
的div的上方和下方(在本例中分别为b&d)。 How can i do this in jquery? 我该如何在jquery中做到这一点?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.