<script type="text/javascript">
$(document).ready(function(){
$('.show').click(function(e){
$(this).closest('.b').css('display','block');
e.preventDefault;
});
});
</script>
<style type="text/css">
.b{ display:none; }
</style>
<div class="a"><a href="#" class="show">show content 1</a></div>
<div class="b">content 1</div>
<div class="a"><a href="#" class="show">show content 2</a></div>
<div class="b">content 2</div>
<div class="a"><a href="#" class="show">show content 3</a></div>
<div class="b">content 3</div>
fiddle page: http://jsfiddle.net/dus4a/3/
so basically I have 3 content to show if I press the link but the closest wont run, can u guys tell me what is wrong ?
Thanks a lot