Making a call with javascript using addEventListener to a create user function, this function does not show the alert. Why are not you accessing the function? Thanks
formu.php
<form action="crear.php" method="post">
<div class="campo">
<label for="nombre">Nombre:</label>
<input type="text" name="nombre" id="nombre" placeholder="Nombre">
</div>
<div class="campo">
<label for="numero">Teléfono:</label>
<input type="text" name="numero" id="numero" placeholder="Número">
</div>
<input type="submit" value="Agregar" id="agregar" class="boton">
</form>
<script src="js/app.js"></script>
the app.js
var agregarContacto = document.getElementById('agregar');
function crearUsuario(){
alert("funciona");
}
agregarContacto.addEventListener('click', function(){
crearUsuario();
});