title: Is there an opposite function of preventDefault() in JavaScript?
body: <p>I am counting words in a text field and after a certain amount of words, I use prevent default. In the else, I would like to re-enable the default commands. </p>
  
  <p>Does <code>preventDefault(</code>) have an opposite function?</p>
  
  <p>Here is some sample code:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;title&gt;preventDefault&lt;/title&gt;
      &lt;style type="text/css"&gt;&lt;/style&gt;
          &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
              $(function() {
                  var wordNum = 3;
                  var input_length;
                  $("#max").text("max word(s): " + wordNum);
                  $("#test").keypress(function(event) {
  
                      input_length = $.trim($(this).val())
                              .replace(/\s+/g, " ")
                              .split(' ').length;
  
                      if (input_length &gt; (wordNum - 1)) {
                          event.preventDefault();
                      } else {
                          return true;
                      }
                  });
              });
  
          &lt;/script&gt;
          &lt;/head&gt;
          &lt;body&gt;
              &lt;div id="max"&gt;&lt;/div&gt;
              &lt;textarea id="test" cols="20" rows="5"&gt;&lt;/textarea&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>It seems to work on IE, but Firefox doesn't like it.</p>