На странице есть кнопка, как сделать так, чтобы при клике на кнопку, всплывал блок div? Спасибо
1 ответ
$(function()
{
$('.btn-alert').on('click', function(event)
{
$(".alert-message").append('<div class="alert alert-success alert-dismissible fade in"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a><h3>success alert</h3><BR><p> action was a success</p></div>');
});
});
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<section class="container">
<div class="row">
<div class="col-md-12">
<h3>Bootstrap Alert Message</h3>
<button id="alert1" class="btn btn-alert btn-success" type="button">Success</button>
<div class="alert-message"> </div>
</div>
</div>
</section>