107
rated 0 times
[
109]
[
2]
/ answers: 1 / hits: 21779
/ 12 Years ago, mon, april 2, 2012, 12:00:00
I need to hide the present div and show next hide
here is my codes
$(document).ready(function() {
$('#next').click(function() {
$(this).next().next().children(div).hide();
$(this).next().next().children(div).show();
});
});
#div2,
#div3 {
display: none;
}
<script src=https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js></script>
<button id=prev>Prev</button>
<button id=next>Next</button>
<hr />
<div id=main>
<div id=div1>Div 1</div>
<div id=div2>Div 2</div>
<div id=div3>Div 3</div>
</div>
DEMO
More From » jquery