Skip to Content Skip to Menu

Simple show and hide toggle

Welcome to the first ever tutorial that I have done. I though I'd start with something simple. HTML wise you will need a link and a div box. The link will need a class attribute of 'showHideBox' and the div will need an id attribute of 'show-hide'.

$(document).on('click', '.showHideBox', function(){  
$('#show-hide').toggle();
});
<div id="show-hide"> Show-Hide Me</div>
<p><a class="showHideBox">Show/Hide Box</a></p>

Demo:

 

Show-Hide Me

Show/Hide Box