jQuery capitalization text input
<p>I need to create a capatalization jQuery plugin with the following features:</p>

<ul>
<li>Auto capitalize every word</li>
<li>When the user hits backspace, he can still correct the character for example he types "John Mayer" but he decided, "Mayer" should be without capital letter, so he changes it into "mayer" with backspace.</li>
</ul>

<p>What I tried so far:</p>

<pre><code>field.on('keyup change', function(e){
  var val = field.val();

  field.val(val.replace(/^(.)|\s(.)/g, function($1){ return $1.toUpperCase( ); }));
});
</code></pre>

<p>The problem is, regex parses the whole value, but only the new characters typed should be parsed.</p>

<p>Thanks for reading</p>
