jQuery - Simple show and hide toggle

Facebook

Publish on Facebook

Twitter

Search

Tag Search

Recently Added

Most Popular

Member Options

07
Aug

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 an id attribute of 'click-item' and the div will need an id attribute of 'show-hide'.

$("#click-item").click(function(){
  $("#show-hide").toggle();
});
<div id="show-hide">
 Show-Hide Me
</div>
<p><a id="click-item">Show-Hide</a></p>

Demo:

Show-Hide Me

Show-Hide