I have the following code to show a message when I press a certain button, but the message disappears almost instantaneously and can not be read correctly:
function informacion() {
document.getElementById("info").innerHTML = "Preferencias Actualizadas!";
}
<div class="text-center">
<button onclick="informacion()" type="submit" value="submit" name="submit" class="btn btn-primary">Guardar</button>
</div>
<br>
<p class="text-center" id="info"></p>