Bootstrap: collapsible elements

HTML

<a data-toggle="collapse" data-target="#demo" class="collapsed" href="">
	show/hide
</a>
 
<div id="demo" class="collapse">
	some content
</div>

JS (to avoid page scrolling bug)

$('a[data-toggle="collapse"]').click(function(e){
	e.preventDefault();
	$(this).data('target').slideToggle();
});

Source: http://stackoverflow.com/a/17627097/91225

Feedback