How to toggle a bootstrap alert on and off with button click?

I’ve had the same problem: just don’t use the data-dismiss from the close button and work with JQuery show() and hide():

$('.close').click(function() {
   $('.alert').hide();
})

Now you can show the alert when clicking a button by using the code:

$('.alert').show()

Hope this helps!

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)