jQuery toggle() animation example

This example shows how to use jQuery toggle() function to show or hide a section inside a paragraph. So by clicking on a button the section will be displayed or hidden using the jQuery toggle() function.

First create the html

Then create jQuery stuff. Add required jQuery library to the <head/> section.

Then create css style and put it under <head/> section


First time when you run the page

jQuery toggle

When you click on the “Click Me” button
jQuery toggle

Thanks for reading.


Software Professional, I am passionate to work on web/enterprise application. For more information please go to about me. You can follow on Twitter. You can be a friend on Facebook or Google Plus or Linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.