title: jQuery changing html text
body: <p>Been trying to change the innerHTML of some elements either on page load or page save.</p>
  
  <p>Basically when I save the HTML page I want the timestamp to update just that once, not on page load or anything... this way people can see when the status was last updated.</p>
  
  <p>I also want to have it so all I need to do is change the class of the <code>#status</code> to <code>close</code> and when the page loads it will automatically change the text inside the div.</p>
  
  <p>Here is my fiddle: <a href="http://jsfiddle.net/MD3Wx/1/" rel="nofollow">http://jsfiddle.net/MD3Wx/1/</a></p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div class="lastChange"&gt;
      This was last updated on: &lt;span class="timestamp"&gt;00:00:00&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class="close" id="status"&gt;
      OPEN
  &lt;/div&gt;
  &lt;hr /&gt;
  &lt;div class="comments"&gt;
      Comments :&lt;br /&gt;
      &lt;span class="timestamp"&gt;00:00:00&lt;/span&gt; &lt;span class="info"&gt;Info&lt;/span&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong>JQUERY</strong></p>
  
  <pre><code>var d = new Date();
  $('.timestamp').each(function() {
     $(this).html(d.toLocaleString);
  });
  
  $(document).ready(function(){
     if($('#status').hasClass("open")){
        $('#status').html("OPEN");
     }
     else{
        $('#status').html("CLOSED");
     }
  });
  </code></pre>