Javascript Ajax jQuery Html PHP Example Quiz New MORE
Need a Website Or Web Application.Contact : +91 9437911966 (Whatsapp) Note: Paid Service

jQuery toggle()

You can also toggle between hiding and showing an element by using toggle() method.

Shown elements are hidden and hidden elements are shown:

The optional speed parameter can take the following values: "slow", "fast", or milliseconds.

The optional callback parameter is a function to be executed after toggle() completes.




<!DOCTYPE html>  
<html lang="en">  
  <meta charset="utf-8">  
  <title>toogle() jQuery Method</title>  
  <script src=""></script>
  	h2 {  
    	color: white;  
<script type="text/javascript">
<button id="button">Show/Hide</button>
<div id="div" style="width:400;height:100px;display:none;background-color:green;"><h2>STUDENTS TUTORIAL</h2></div>

Run it Yourself »