I'm trying to use bootstrap alert in a project, but I'm having a hard time doing it, what I have at the moment is this:
if (sNome == "" || sTel == "" || sCEP == "" ){ $("p.erro").html("Todos os campos devem ser preenchidos"); return false; } else if ( !(emailFilter.test(sEmail)) || sEmail.match(illegalChars) ){ $("p.erro").html("Por favor, informe um email válido."); return false; }
And I'm displaying the message this way:
<p class="erro" align="center"></p>
But I would like to be able to display in this format:
<div class="alert alert-danger">
<strong>Atenção: </strong> Todos os campos precisam ser preenchidos.</div>
When trying to make this change, the div
of the alert
is always visible, I tried to change it this way:
$(".alert").html("Todos os campos devem ser preenchidos");
But as I said it was not correct.