dynamic hide div
All div hide by default and show div dynamic on click of link
HTML
<a href="#" class="myLink" id="1">this is 1</a>
<a href="#" class="myLink" id="2">this is 2</a>
<a href="#" class="myLink" id="3">this is 3</a>
<div align="justify" id="div_dom1" class="myClass">
Text will display here for 1
</div>
<div align="justify" id="div_dom2" class="myClass">
Text will display here for 2
</div>
<div align="justify" id="div_dom3" class="myClass">
Text will display here for 3
CSS
.myClass {
display: none;
}
JavaScript
$(document).ready(function () {
$(".myLink").on('click',function(){
$(".myClass").hide();
var divno = $(this).attr('id');
$("#div_dom" + divno).show();
});
});