What is Toggling?
Basically a show/hide feature for your webpage elements. For example, you may have a login box in your webpage, and you want your visitors to click on a button for showing or hiding the element.
This tutorial will show you how to implement a simple toggle effect in your webpage using jQuery.
As always, we will require some HTML content first
- <a id="clickMe">Toggle my text</a>
- <br />
- <div id="textBox">This text will be toggled</div>
jQuery code
This is the code that makes the 'textBox' element toggle
- $("#textBox").toggle();