Dealing with bootstrap alert

hello guys,

I got some problem while dealing with bootstrap alert.

How to show bootstrap alert div again

when we close alert div box, then if again we can’t show that div box. even if we write jquery show() function.

solution:

checkout  <a> tag there you got data-dismiss=”alert” , this will remove div from dom so that’s why we can’t show that div again. so just remove that and bind your function to that div

code:

<a id=”lieclose” onclick=”general_close(this.id)”>×</a>

jquery code:

function general_close(id)
{
	var current_id = "#"+id;
	$(current_id).parent().hide();
}

above function will work for any alert div. just change your id in a tag.

How to redraw bootstrap-error message

$('#loginerrbox').empty();
$('#loginerrbox').append("Please enter valid credentials. 
<a id='crdlogerr' class='close' onclick='general_close(this.id)'>×</a>");					
$('#loginerrbox').show();

above code demonstrate how to redraw new error message on alert div.

hope you like above Tips 🙂