Show that how do we close multiple alerts at a time in Bootstraps ?

 Posted by Vivek.Ramapuram on 6/13/2015 | Category: Bootstrap Interview questions | Views: 2048 | Points: 40
Answer:

In Bootstraps if you want to close all the alert messages at once.
Here is the example :
We should write Java script code and HTML 5 code.

Javascript:
<script type="text/javascript">

$(document).ready(function ()
{
$(".close").click(function ()
{
$("#Danger").alert('close');
});
});
</script>


HTML :
 <div id="Danger">

<div class="alert alert-danger">
<a href="#" class="close">&times;</a>
<strong>Error!</strong> There was a problem around your network
</div>
<div class="alert alert-danger">
<a href="#" class="close">&times;</a>
<strong>Error!</strong> There was a problem building solution.
</div>
</div>


Run the code combination in the browser for out put


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response