<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="css/bootstrap.css" />
<script type="text/javascript" src="js/jquery-1.11.0.js" ></script>
<script type="text/javascript" src="js/bootstrap.js" ></script>
</head>
<body style="margin: 200px;">
<div class="modal fade" id="delete">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
提示
</div>
<div class="modal-body">
你真的要删除吗
</div>
<div class="modal-footer">
<button class="btn btn-default" data-dismiss = "modal">取消</button>
<button class="btn btn-primary sure" data-dismiss = "modal">确定</button>
</div>
</div>
</div>
</div>
<div class="alert alert-danger">
警告框内容
<button class="close" data-toggle="modal" data-target="#delete">
×
</button>
</div>
<div class="alert alert-warning">
警告框内容
<button class="close" data-toggle="modal" data-target="#delete">
×
</button>
</div>
<script>
$(function(){
$(".sure").click(function(){
$(this).parents(".modal").next(".alert").alert("close")
})
})
</script>
</body>
</html>