I am using an ajax script to generate text in a success message. The final part of the process is to add a close image DIV which when clicked should close (slide up) the 'panel' DIV which contains the form and the success message, as happens when the close image is clicked on without sending any message. You can see the form by clicking on 'contact' in the nav bar on [this page](http://salliannputman.com/test/index.php).

Here is the script that generates the success message:

```
$.ajax({
         type: "POST",
         url: "contact-engine.php",
         data: dataString,
         success: function() {
           $('#contact-form').html("<div id='message-form'></div>");
           $('#message-form').html("<h3>Your message has been submitted successfully!</h3>")
           .hide()
           .fadeIn(2000, function() {
             $('<p style="text-align:center">Thanks for getting in touch. I will get back to you as soon as possible.</p>').appendTo('#message-form').hide().fadeIn(2000, function() {
             $('<p style="text-align:center"><a class="close" href="#"><img src="/images/close.png"></a></p>').appendTo('#message-form').hide().fadeIn(2000);
             });
           });
         }
       });

```

And here is the script that handles the click function on the close button DIV:

```
$(".close").click(function ()
        {
            $("#panel").slideUp("slow");
            $("li#contact").removeClass("current");
    //        $("#contact").removeClass("current");
            $panel.visible = false;
            return false;
        });

```

Could someone please let me know why the close button is outside the DIV and why it won't close the form from the success message?

Thanks,

Nick