×Warning! Your network connection is having issues.
[Try it Β»](#)
The result is as follows:

## Options
_No options._
## Methods
Here are some useful methods for the Alert plugin:
| Method | Description | Example |
| --- | --- | --- |
| .alert() | This method makes all alerts dismissible. | $('#identifier').alert(); |
| **Close method** .alert('close') | Closes all alerts. | $('#identifier').alert('close'); |
> To enable animation when closing, ensure you have added the **.fade** and **.in** classes.
### Example
The following example demonstrates the use of the **.alert()** method:
## Example
Alert Plugin alert() Method
×Success! The operation was successful.
×Warning! Your network connection is having issues.
$(function(){ $(".close").click(function(){ $("#myAlert").alert(); $("#myAlert2").alert(); }); });
[Try it Β»](#)
The following example demonstrates the use of the **.alert('close')** method:
## Example
Alert Plugin alert('close') Method
×Success! The operation was successful.
×Warning! Your network connection is having issues.
$(function(){ $(".close").click(function(){ $("#myAlert").alert('close'); $("#myAlert2").alert('close'); }); });
[Try it Β»](#)
You can see that the dismiss functionality is applied to all alerts. Closing any alert will also close the remaining alerts.
## Events
The table below lists the events used in the Alert plugin. These events can be used as hooks in functions.
| Event | Description | Example |
| --- | --- | --- |
| close.bs.alert | This event fires immediately when the _close_ instance method is called. | $('#myalert').bind('close.bs.alert', function () { // Perform some action...}) |
| closed.bs.alert | This event is fired when the alert has been closed (will wait for CSS transition to complete). | $('#myalert').bind('closed.bs.alert', function () {// Perform some action...}) |
### Example
The following example demonstrates the events of the Alert plugin:
## Example
×Success! The operation was successful.
$(function(){ $("#myAlert").bind('closed.bs.alert', function(){alert("The alert message box has been closed."); }); });
[Try it Β»](#)
The result is as follows:

YouTip