jQuery parents not working with remove
<p>I have the following code:</p>

<pre><code>$(document).ready(function(){

            $(".uiCloseButton").click(function(e)
            {
                e.preventDefault();
                var element = $(this).parents('.uiOverlay');
                alert(element);
                element.fadeOut(200,
                    function()
                    {
                        alert(element);
                        element.remove();
                    });
            });

        });
</code></pre>

<p>The idea is that when the close button is clicked it will remove it's highest parent using the <code>parents()</code> method. I have been alerting the variable element to check its value and it always returns as <code>[object Object]</code> when surely it should contain the parent element?</p>

<p>However it does still fade the element so it's working BUT doesn't remove the element from the DOM so it's only half working...</p>

<p>Any ideas why it's not removing the element and why the element var is empty?</p>

<p>Thanks</p>
