I have some div elements in a sequence, like :
<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. 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. How can i do this in jquery?
You can use
.prev()and.next()http://jsfiddle.net/MAd2K/