I have a button which opens a panel and I want to be able to close it like I would with an alert.
The Default panel example from bootstrap docs
You can do this by using an undocument feature to set the target of the dismiss action...
×Close
This will make the close button close the panel as opposed to its parent element.