1

На странице есть кнопка, как сделать так, чтобы при клике на кнопку, всплывал блок div? Спасибо

1

1 ответ 1

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">&times;</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>

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.