Bootstrap .modal("toggle") method

Use the .modal("toggle") method in Bootstrap to toggle the modal.

As shown below, the modal generates on the click of a button ?

$(document).ready(function(){
  $("#button1").click(function(){
    $("#newModal").modal("toggle");
  });
});

Here is the button used above ?

You can try to run the following code to implement the modal("toggle") method ?

Example


  
    Bootstrap Example
    
    
    
    
    
  

  
   

Sample

         
 
Updated on: 2026-03-11T22:50:42+05:30

3K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements