Writing a loop with JQUERY
<p>I want to check whether an element has no hrefs in it (ie it is empty) and if it is, to hide the label associated with it. There will be several elements on the page that need to be checked if they are empty so I will need to write a loop. I need help writing the loop please. Here is my code so far:</p>

<pre><code>if(jQuery('span.tags').is(':empty')) {
        jQuery('span.label').hide()        
    };
</code></pre>

<p>Please can someone help me with this code?</p>

<p>This is my HTML</p>

<pre><code>&lt;div class="entry-meta"&gt;  
            &lt;span class="label"&gt;Tagged:&lt;/span&gt;
           &lt;span class="tags"&gt; 
            &lt;a href="#" rel="tag"&gt;Career change&lt;/a&gt;, 
            &lt;a href="#" rel="tag"&gt;career change e course&lt;/a&gt;, 
            &lt;a href="#" rel="tag"&gt;career help&lt;/a&gt;
           &lt;/span&gt;
    &lt;/div&gt;&lt;!-- END .entry-meta --&gt;
</code></pre>

<p>Thanks to everyone who answered this post. Thisis the solution that worked.</p>

<pre><code>//Removes word 'Tagged:' if there are no tags
jQuery('span.tags:empty').prev('span.label').hide();
</code></pre>
