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.

Soumitra Roy Sarkar

I am a professional Web developer, Enterprise Application developer, Software Engineer and Blogger. Connect me on Twitter Facebook  Google Plus Linkedin

Leave a Reply

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