Call a javascript function from a link. All possibile methods
<p>I have a div ~ id is <code>slider</code> i want it to animate/hide when a link is clicked. More precisely i want to toggle it open and close from a link.</p>

<h1>jQuery</h1>

<pre><code>&lt;script type="text/javascript"&gt; 
    $("#toggleslider").click(function () {
    $(this).hide("#slider", { direction: "up" }, 1000);
    });
&lt;/script&gt;
</code></pre>

<h1>link</h1>

<pre><code>&lt;li&gt;&lt;a id="toggleslider" href="javascript:void(0);"&gt;toggle&lt;/a&gt;&lt;/li&gt;
</code></pre>
