title: add li & also clear a input field once a submit button is clicked jQuery
body: <p>Once the submit button is pressed I want to add the li which works with this code but I also want to clear the input filed as well. Where do I add a .reset? or other method, I did a .reset() after the input and does not work. Maybe the positioning is off?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('.sub').click(function(e){
      var userInput = $('#input').val();
      $('#ul').append('&lt;li&gt;'+userInput+'&lt;/li&gt;');
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;h2&gt;Enter food here&lt;/h2&gt;
      &lt;input id = 'input'&gt;&lt;/input&gt;
      &lt;button class ='sub'&gt;Submit&lt;/button&gt;
  &lt;/div&gt;
      &lt;div class = 'para'&gt;
          &lt;h2&gt;Shopping List&lt;/h2&gt;
          &lt;ul id = 'ul'&gt;
          &lt;/ul&gt;
      &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>