Try something like this: http://jsfiddle.net/Q2tFx/10/
$.fn.capitalize = function () {
var wordsToIgnore = ["to","and","the","it", "or", "that", "this"],
minLength = 3;
function getWords(str) {
return str.match(/\S+\s*/g);
}
this.each(function () {
var words = getWords(this.value);
$.each(words,function(i,word) {
// only continue if word is not in ignore list
if (wordsToIgnore.indexOf($.trim(word)) == -1 && $.trim(word).length > minLength) {
words[i] = words[i].charAt(0).toUpperCase() + words[i].slice(1);
}
});
this.value = words.join("");
});
};
$('.title').on('blur', function () {
$(this).capitalize();
}).capitalize();
currently set to ignore words shorter than 3 characters and the ones in the list