I do not understand why the function that believes in java script with this form does not work for me, simplify the code so that the problem can be better understood
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>
Obligatorio
</title>
<link rel="stylesheet" href="./css/Estilo.css">
<link rel="stylesheet" href="./css/EstilosChico.css"
media="screen and (max-width: 600px)">
</head>
<body>
<form action="no_existe.html" method="get" id="miformulario">
<textarea rows="8" cols=80" id="comentarios" placeholder="Ingrese los comentarios" ></textarea>
<script>
function hizoClick() {
event.preventDefault();
var text = document.getElementById("comentarios").value.toUpperCase();
if (text.indexOf("EXCELENTE") != -1) {
alert("El campo comentarios contiene Excelente");
} else {
document.getElementById("miformulario").submit();
enviado();
}
</script>
<script>
function enviado() {
alert('Informacion Enviada')
}
</script>
<button type="button" name="button" id="boton" onclick="hizoClick();">Enviar</button>
</form>
</body>
</html>