When I click the close icon of the error message, the Bootstrap javascript function simply destroys the #msg
container that receives the error messages, preventing the next time an error occurs the container does not appear with the message because it no longer exists in the first close .
...msg='<buttontype="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>';
msg += '<strong>Atenção! </strong>Todos os campos precisam ser preenchidos.';
// Verificando se todos os dados foram inseridos
if((username == '' || username == null) ||
(password == '' || password == null)){
$('#msg').empty();
$('#msg').removeClass('hidden').append(msg);
return false;
} else {
...
Question: How can I work around this problem?