title: Prevent Addition input
body: <p>I want to stop taking input in the text field once 10 characters have been entered.</p>
  
  <p>What I have so far is not working:</p>
  
  <pre><code>$(document).ready(function() {
    $('#comment').keypress(function(event){
  
      if ($('#comment').val()).length == 10) {
          event.preventDefault();
      }
  
    });
  });
  </code></pre>
  
  <p>What am I missing?</p>