The task is to empty the fields after clicking the "submit" button... I used this function:
setInterval(
function submitForm() {
document.getElementById("algo").reset();
}, 3000);
But the problem is that it takes one or two seconds to send the mail and the function is executed instantly, the result is that the fields are emptied and then the mail is sent (arriving empty) ... in that order (function --> submit) and the real success must be : submit --> function
In addition, the function does not work since the interval is short if the message is long and it is long if I put "submit" and the text continues without disappearing