title: Getting the value of last div in AJAX request
body: <p>I'm building a small chat application to learn a bit about jquery and AJAX.
  It's all working great, but at the moment, the chatbox is grabbing the HTML of log.html on an interval with the following code:</p>
  
  <pre><code>function loadLog(){     
            $.ajax({
              url: "log.html",
              cache: false,
              success: function(html){    
                  $(".chatbox").html(html); //Insert chat log into the #chatbox div
                },
          });
      }
  </code></pre>
  
  <p>Now if a user is trying to copy a line, it's bugging out because the html is getting refreshed every few seconds.
  So I would like to build a check that remembers the last known message and compares it to the last message in the log. If they don't match (a new message has appeared), only then will the browser refresh the html in the chatbox.</p>
  
  <p>I'm quite new to AJAX and Jquery so I would like to ask you guys the following question:
  <strong>What would be the best way of comparing the last message in log.html and the last div in the chatbox div?</strong></p>
  
  <p>My theory would be to </p>
  
  <pre><code>success: function(html){    
              $(html).find(last(div));
            },
  </code></pre>
  
  <p>But i don't exactly know how to get the value of the last div.</p>
  
  <p>I hope I explained the question well enough.
  Also, any ideas are welcome :)</p>
  
  <p>P.S. This is an example of a line in log.html</p>
  
  <pre><code>&lt;div class='msgln'&gt;(4:40 PM) &lt;b&gt;Jeroen&lt;/b&gt;: Welcome&lt;br&gt;&lt;/div&gt;
  </code></pre>