Bootstrap Event when the modal is fully hidden

The hidden.bs.modal event in Bootstrap fires when the modal is completely hidden.

Firstly, click on the hide button to hide the modal ?

$("#button1").click(function(){
  $("#newModal").modal("hide");
});

After clicking the button, the hidden.bs.modal fires and generates an alert using the following script ?

$("#newModal").on('hidden.bs.modal', function () {
  alert('The modal is completely hidden now!');
});

Let us see an example to implement the hidden.bs.modal event ?

Example



  Bootstrap Example
  
  
  
  
  

  



  
   

Sample

   

This is demo text.

   

This is demo text.

   

This is demo text.

   

This is demo text.

   

This is demo text.

   

This is demo text.

   

This is demo text.

   

This is demo text.

   

This is demo text.

   

This is demo text.

   

This is demo text.

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

865 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements