looping through new div as they are created
<p>I have a div, let's call it class="phoneNo". Inside the div there are two links, one to add another div just like it, and another to delete the div itself. I'm trying to create a loop where if there's only 1 of these divs, the "delete" link should hide, and if there are more than 1 of these divs, the "delete" link should show up on all the divs.
<br><br>
So far I came up with this, but no success:</p>

<pre><code>var pCount = $(".phoneNo").length;
                $(pCount).each(function(){
                    if (pCount &lt;= 1) {
                        $("a.deleteThis").hide();
                     } 
                     else if (pCount &gt;= 1) {
                        $("a.deleteThis").show();
                     }
                     return true;
                });
</code></pre>

<p><strong>EDIT</strong> (3.21.10):</p>

<p>According to jWhiz's advice below, I reworked what I have. The code is error-free and everything works, except for the hiding/showing of the "Delete" link. </p>

<p>Here's my code (some points are irrelevant to the problem, but may help rework my logic flow):</p>

<pre><code>function checkHide() {
                    if ($(".phoneNo").length == 1)
                      $(".deleteThisPhone").hide();
                    else
                      $(".deleteThisPhone").show();
                  }
                //adding and deleting phone numbers in popup
                $(".addNewPhone").live("click", function(){
                    clicked = $(this);
                    grandFather = clicked.parent().parent();
                    cloneCurr = grandFather.clone(true).find("input").each(function(){
                        $(this).val("")        
                    }).end().animate({opacity:"show"})
                    grandFather.after(cloneCurr)
                    checkHide();
                    newHeight = $("#fancybox-wrap").height();
                    $('#fancybox-wrap').css({"height": newHeight + 66 + "px" });
                        return false
                });
                $(".deleteThisPhone").live("click",function(){
                    $(this).parent().parent().slideUp(150);
                    newHeight = $("#fancybox-wrap").height();
                    $('#fancybox-wrap').css({"height": newHeight - 66 + "px" });
                    checkHide();
                });
</code></pre>
