This is my code is a simple form:
<!DOCTYPE html>
<html>
<head>
<title>Formulário</title>
<meta charset="utf-8" />
</head>
<body>
<form name="meu_form">
<h1>Formulário</h1>
<p class="nome">
<label for="nome">Nome</label>
<input type="text" id="nomeid" required="required" name="nome" />
</p>
<p class="fone">
<label for="fone">Fone</label>
<input type="text" id="foneid" name="fone" />
</p>
<p>
<label for="email">Email</label>
<input type="email" id="emailid" name="email" />
</p>
<p class="submit">
<input type="submit" onclick="enviar()" value="Enviar" />
</p>
</form>
<script type="text/javascript">
function enviar() {
var nome = document.getElementById("nomeid");
var fone = document.getElementById("foneid");
var email = document.getElementById("emailid");
if (nome.value != "") {
console.log('Obrigado sr(a) ' + nome.value +
' os seus dados foram encaminhados com sucesso.\n'
+'Seus dados:\n'
+'Nome : '+ nome.value
+'\nFone '+ fone.value
+'\nEmail '+ email.value);
}
}
</script>
</body>
</html>
If I replace the console with the alert it works fine, but I want to use the console.
The problem is that when I want to see the output on the browser console Chrome (I have not tested on others) it is displayed so fast that it does not read.
What should I do?