title: jQuery Defining Custom Functions
body: <p>I'm trying to a define my own function in jQuery to condense my js file, but I seem to be unable to shorten these two lines. Below is:</p>
  
  <p>*My function</p>
  
  <p>*What it looks like with the function</p>
  
  <p>*What the original code looks like without the function</p>
  
  <pre><code>var AddContent = function(content) {
      $(#log li:last).remove();
      $(#log).append(content);
  };
  
  
      $('.object').click(function(){
          AddContent('&lt;li&gt;content1&lt;/li&gt;');
      });
  
  
  
      $('.object').click(function(){
          $('#log li:last').remove();
          $('#log').append('&lt;li&gt;content1&lt;/li&gt;');
      });
  </code></pre>
  
  <p>What am I doing wrong? Help! </p>