title: Change TD Element in jQuery
body: <p>I'm creating a webpage with announcements which pulls from the database. Here is my HTML code</p>
  
  <pre><code>&lt;table width="100%" border="0"&gt;
  &lt;?php while($row = mysql_fetch_array($result)){ ?&gt;
     &lt;tr&gt;
        &lt;td id="maintitle" style="font-size: 34px; font-weight: bold;"&gt;&lt;?php print  $row['title'];   ?&gt;&lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
        &lt;td id="maincontent"&gt;&lt;?php print $row['content'];?&gt;&lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
        &lt;td id="mainname" style="font-size: 12px; font-style: italic;"&gt;&lt;?php print $row['name'];?&gt;&lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
        &lt;td&gt;&amp;nbsp;&lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
        &lt;td&gt;&amp;nbsp;&lt;/td&gt;
     &lt;/tr&gt;
  &lt;?php }?&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>What I want, is for the TD element to display a particular text if there are not announcements and I've decided to use jQuery for that. Here is my code for it</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
     $(document).ready(function(){
        $('#maintitle',this).each(function(){
           if($(this).html() != '');
              $(this).append("No Incidents recorded!");
        });
     });
  &lt;/script&gt;
  </code></pre>
  
  <p>However, even when there are no announcements in database, nothing happens. I was wondering if there is a different way to go about it, or changing the jquery code.</p>