How do I hide the #changes-saved
code using jQuery?
For example let's say the code is displayed when the user clicks the submit button and then leaves the current web page and then returns back to the web page and the #changes-saved
is no longer displayed until the submit button is clicked again.
Here is the jQuery code.
$(function() {
$('#changes-saved').hide();
$(".save-button").click(function() {
$.post($("#contact-form").attr("action"), $("#contact-form").serialize(), function(html) {
$("div.contact-info-form").html(html);
$('#changes-saved').append('<li>Changes saved!</li>').show().pause(1000).hide();
});
return false; // Prevent normal submit.
});
});