getting nth:child jquery
<p>I have this html block</p>

<pre><code>    &lt;div id="pane" class="MosadBoxRight scroll_pane" style="overflow: hidden; height: 590px; width: 250px; padding: 0px 41px 0px 0px;"&gt;
                &lt;div class="MosadBoxRightKoteretpopUp"&gt;text&lt;/div&gt;
                &lt;div class="area" id="area1"&gt;
&lt;a iframe="/4746929" style="cursor:pointer" class="alink" id="aLink"&gt;example1
 &lt;/a&gt;&lt;/div&gt;
                &lt;div class="area" id="area2"&gt;
&lt;a  iframe="4746929" style="cursor:pointer" class="alink" id="aLink"&gt;example1 
&lt;/a&gt;&lt;/div&gt;
                &lt;div class="area" id="area3"&gt;
&lt;a  iframe="/474692946" style="cursor:pointer" class="alink" id="aLink"&gt;example1
&lt;/a&gt;&lt;/div&gt;

        &lt;/div&gt;
</code></pre>

<p>I have also this javascript function</p>

<pre><code>  function nextchapter() {
     loc=loc+1;
     var contextCmsPage = $("#pane .alink:nth-child(0)").attr("iframe");


     }
</code></pre>

<p>and a button that call this function</p>

<pre><code>&lt;input type="button" id="btnc" onclick="nextchapter()" value="check" /&gt;
</code></pre>

<p>I am trying to get nth child of class <code>alink</code> in father Div <code>pane</code> </p>

<p>I getting undefinded for  <code>$("#pane .alink:nth-child(0)").attr("iframe");</code></p>

<p>I also tried</p>

<pre><code>$("#pane").find(".alink:nth-child(0)").attr("iframe");
</code></pre>

<p>with same result</p>

<p>What can be the problem?</p>

<p>Thanks</p>

<p>Baaroz</p>
