jQuery issue with :first-how to solve
<p>I have a span tag in html and this <code>&lt;span&gt;</code> can appear multiple times on the page.</p>

<p>I want to select only the first span tag. I am doing it like this</p>

<pre><code>var $myvar= $(".mydiv .indiv .myspan:first");
</code></pre>

<p>For now its working fine.</p>

<p>I think my code will prevent the browser from traversing the whole DOM, as I am using <code>:first,</code> which will improve performance. Am I correct?</p>

<p>One more question:</p>

<p>HTML:</p>

<pre><code>&lt;div class="mydiv"&gt;
    &lt;div class="indiv"&gt;
        &lt;span&gt;myspan&lt;/span&gt;
        &lt;a href="#" class="anc1"&gt;a1&lt;/a&gt;
        &lt;a href="#" class="anc2"&gt;a2&lt;/a&gt;
    &lt;/div&gt;
    &lt;table&gt;
    ..................
    &lt;/table&gt;
&lt;/div&gt;
</code></pre>

<p>This html is having 2 anchor tags.I want to write a function on click of this 'a' tag.For that I can try something like $(".mydiv .indiv a").click(function(e)
and it will work.but lets say, there is a same repeating structure in HTMl , so it will work for repeating set 'a' tags also, which i dont want.I want only the first set of 'a'
tags to work.
The functionality of 'a' tag is , onload 2 nd one will be in hide state, so on click of 1st, the 2nd one will be dispalyed and first one will be in hide state,and on click of 2 nd reverse action will happen, hope this time i have made myself clear :-)</p>
