for each function jquery
<p>i have a toggle function which i have working fine, only i cant get it to work for each element on the page.</p>

<p>my current function is</p>

<pre><code>$(".tog").click(function() {
                $("#shortinfo").toggle();
                $('#shortinfo').toggleClass('open');
                return false;
            })
</code></pre>

<p>ive tried</p>

<pre><code>$(".tog").each.click(function() {
                $("#shortinfo").toggle();
                $('#shortinfo').toggleClass('open');
                return false;
            })
</code></pre>

<p>and </p>

<pre><code>$(".tog").each (click(function() {
                $("#shortinfo").toggle();
                $('#shortinfo').toggleClass('open');
                return false;
</code></pre>

<hr>

<p>I have an accordion similar too</p>

<pre><code>&lt;h1&gt;title &lt;/h1&gt;
&lt;div class="shortcontent"&gt;asdasdasd&lt;/div&gt;
&lt;div class="longcopy"&gt;long stuff here&lt;/div&gt;

&lt;h1&gt;title &lt;/h1&gt;
&lt;div class="shortcontent"&gt;asdasdasd&lt;/div&gt;
&lt;div class="longcopy"&gt;long stuff here&lt;/div&gt;

&lt;h1&gt;title &lt;/h1&gt;
&lt;div class="shortcontent"&gt;asdasdasd&lt;/div&gt;
&lt;div class="longcopy"&gt;long stuff here&lt;/div&gt;

&lt;h1&gt;title &lt;/h1&gt;
&lt;div class="shortcontent"&gt;asdasdasd&lt;/div&gt;
&lt;div class="longcopy"&gt;long stuff here&lt;/div&gt;
</code></pre>

<p>the idea is when its clicked 'shortcontent' dissapears. at the moment that is only happening on the first section</p>
