$("form").submit(function() { var th = $(this); $.ajax({ type: "POST", url: "mail.php", data: th.serialize() }).done(function() { alert("Thank you!"); setTimeout(function() { th.trigger("reset"); }, 1000); }); return false; }); There is a script to send the form, tell me how, instead of an alert, display the hidden div with thanks?