I have this code working: http://jsfiddle.net/Q2tFx/
$.fn.capitalize = function () {
$.each(this, function () {
var split = this.value.split(' ');
for (var i = 0, len = split.length; i < len; i++) {
split[i] = split[i].charAt(0).toUpperCase() + split[i].slice(1);
}
this.value = split.join(' ');
});
return this;
};
$('.title').on('keyup', function () {
$(this).capitalize();
}).capitalize();
I would like to have a list of words of exceptions.
Also, I don’t want to capitalize words with 3 or less characters.
How could I do this?
Thanks!
Try something like this: http://jsfiddle.net/Q2tFx/10/
currently set to ignore words shorter than 3 characters and the ones in the list