How to add a class to empty h1 with jQuery?
<p>I'd like to add a class 'hideme' to a empty div.</p>

<pre><code>&lt;div id="infocontent" class="grid_15 prefix_1"&gt;

     &lt;h1 id="mainhead" class="grid_15 alpha omega" &gt;&lt;/h1&gt;
     &lt;div id="infoinner" class="grid_13 prefix_1 suffix_1 alpha omega"&gt;


    &lt;FORM ACTION="command.asp" METHOD="get" NAME="artForm"&gt;

   ....
   .....
</code></pre>

<p>I made this but something wrong.</p>

<pre><code>$function(){
var contentid = $('#mainhead');
var content = contentid.html();
if (content===''){
    contentid.addClass('hideme');
}
})
</code></pre>

<p>I appreciate you help.</p>

<p>Thanks in advance.</p>

<p>Update: Sorry it was empty h1.</p>
