I have a registration page, and when the data is entered wrong, a alert();
appears informing the error, but I would like it to be an error message, just below the fields. I put a span with an error message and with the class sr-only
of the boostrap that makes what I wrote remain invisible, but how do I use js to make the class disappear? would be in place of the alert that is in echo.
HTML
<span id="cpf"></span>Cadastrar</button>
<span class="sr-only">Dados incorretos.</span>
PHP
echo"<script type='text/javascript'>alert('Alguém com esses dados já se cadastrou. Tente novamente.');window.location.href='cadastro.php';</script>";