jQuery display problem?

Posted by SLAPme on Stack Overflow See other posts from Stack Overflow or by SLAPme
Published on 2010-03-23T06:35:07Z Indexed on 2010/03/23 6:53 UTC
Read the original article Hit count: 168

Filed under:
|

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.
    });
});

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about html