Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap alerts not closing

I am having trouble closing my bootstrap alert. I have my jquery declared before bootstrap and the alerts still do not close. The code for the alert is below. Any ideas?

  <!-- jquery -->
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>

  <!-- bootstrap -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">


  <div class="alert alert-success alert-dismissible" role="alert">
     <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
     <strong>Yay</strong> Your email has been added!
  </div>
like image 498
Billy Avatar asked Feb 10 '23 12:02

Billy


1 Answers

You still need to add Twitter Bootstrap core JS.

<!-- jquery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>

<!-- bootstrap -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">


<div class="alert alert-success alert-dismissible" role="alert">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span>
  </button>
  <strong>Yay</strong> Your email has been added!
</div>
like image 172
m4n0 Avatar answered Feb 23 '23 06:02

m4n0