Bootstrap警报未关闭

Bil*_*lly 3 jquery twitter-bootstrap

我无法关闭我的引导警报.我在引导程序之前声明了我的jquery,警报仍未关闭.警报的代码如下.有任何想法吗?

  <!-- 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>
Run Code Online (Sandbox Code Playgroud)

Man*_*mar 9

您仍然需要添加Twitter Bootstrap核心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>
Run Code Online (Sandbox Code Playgroud)