Calling jQuery function from from js
<p>I've written a Simple function in Javascript which calls a jQuery function 
the problem is Why do I need to click button to get the toggle effect </p>

<p>html</p>

<pre><code>&lt;input id="toggle" type="button" value="Toggle" onclick="toggle()" /&gt;
</code></pre>

<p>javascript</p>

<pre><code>&lt;script type="text/javascript"&gt;
function toggle()
{
    new_toggle();
}
&lt;/script&gt;
</code></pre>

<p>jQuery </p>

<pre><code>$(function new_toggle2(){
        $('#toggle').click(function(){

    $('#p1').toggle(); // Simple &lt;p&gt; and &lt;h1&gt; tags
            $('#h').toggle();   
        });
    new_toggle = new_toggle2;
});
</code></pre>
