I'm doing a web page, and I'd like to add a mailto (send an email), through SweetAlert, but it gives me an error and disables some dynamic buttons that I have. Does anyone know if it is possible to do it? I enclose my code in case you can help me. I have been checking, and I just get an error with the form in the JS. If I change the label and put a title (h2, for example), I do not get an error.
Thanks in advance!
JS:
$("#email").on("click", function (){
swal({
allowOutsideClick: false,
title: '¡Enviame un correo!',
html: "<form action="mailto:[email protected]?subject=Contacto%20pag%20Web" method="post" enctype="text/plain">Nombre:<br><input type="text" name="name"><br>E-mail:<br><input type="text" name="mail"><br>Commentarios:<br><input type="text" name="commentarios" size="50"><br><br><input type="submit" value="Send"></form>"
})
})
HTML:
<!-- Botón contactame -->
<button class="btn boton2" title="Enviar correo"><a href="#" id="email" class="estiloboton"><i class="far fa-envelope"></i></a></button>