JSFiddle - React, Tailwind, and code Playground
HTML
<input name="crmForm$lastname" type="text" maxlength="50" id="crmForm_lastname" tabindex="2080" class="textBox" onblur="crmForm_lastname_onblur.apply(this, [this]);" style="width: 496px;">
JavaScript
function crmForm_lastname_onblur(sourceField, sourceRowId) {
var x=document.getElementById("crmForm_lastname");
x.value=x.value.toLowerCase().replace(/\b[a-z]/g, function(letter) {
return letter.substr(0,1).toUpperCase()+letter.substr(1);
});
console.log(x.value);
}