I\'m looking for an example of how to capitalize the first letter of a string being entered into a text field. Normally, this is done on the entire field with a function, r
$('input[type="text"]').keyup(function(evt){ var txt = $(this).val(); // Regex taken from php.js (http://phpjs.org/functions/ucwords:569) $(this).val(txt.replace(/^(.)|\s(.)/g, function($1){ return $1.toUpperCase( ); })); });