<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Bootstrap历练实例:警告框(Alert)插件的方法</title>
<meta charset="utf-8" />
<meta name="viewport"content="width=device-width,initial-scale=1.0" />
<script src="jQuery/jquery-2.1.4.js"></script>
<link rel="stylesheet"href="bootstrap-3.3.5-dist/css/bootstrap.min.css" />
<script src="bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container" style="padding:20px">
<div class="alert alert-success">
<a href="#"class="close"data-dismiss="alert"aria-hidden="true">×</a>
<strong>成功!</strong>结果是成功的。
</div>
<div class="alert alert-warning">
<a href="#"class="close"data-dismiss="alert"aria-hidden="true">×</a>
<strong>警告!</strong>网络连接有问题。
</div>
</div>
<script>
$(document).ready(function () {
$(".close").click(function () {
//$(this).alert();
$(this).alert("close");
})
})
</script>
</body>
</html>