There are number of examples for add and remove in jquery. But my code is bit different to examples. when i click add it show second and if i click again on add i want show third as well as when i click remove hide the third also until five. Here is my code
CSS
#second {
display: none;
}
#third {
display: none;
}
#forth {
display: none;
}
#fifth {
display: none;
}
HTML
<div id="header">
<a href="#" id="add1">add</a> - <a href="#" id="remove">remove</a>
<div id="first"><a href="#">first</a></div>
<div id="second"><a href="#">second</a></div>
<div id="third"><a href="#">third</a></div>
<div id="forth"><a href="#">forth</a></div>
<div id="fifth"><a href="#">fifth</a></div>
</div>`
JavaScript
$(document).ready(
function() {
$("#add1").click(function() {
$("#second").show();
});
$("#remove").click(function() {
$("#second").hide();
});
});
HERE IS CODE JSfiddle