Hiding a table on clicking the text inside h1 element
<p>I want to show a table on page load but want to show/hide in an expand/collapse manner.</p>

<p>I am unable to do so using the following code:</p>

<pre><code>$(window).load(function () {
    $(document).ready(function () {     
        $("table").hide();
        //toggle the componenet with class msg_body
        $("h1").click(function () {
            $(this).next("table").slideToggle(500);
        });
    });
});
</code></pre>

<p>Please suggest how this can be achieved? Thanks.</p>
