In which personal names I want to leave it but organized, I have a script that leaves the first capital letters of the name, but it does not ignore those of, etc, etc. I wanted to know if it is possible to add this exception to the script !
function c(id) {
var letra = document.getElementById(id).value;
letra = letra.split("");
var tmp = "";
for (i = 0; i < letra.length; i++) {
if (letra[i - 1]) {
if (letra[i - 1] == " " || letra[i - 1] == ".") {
letra[i] = letra[i].replace(letra[i], letra[i].toUpperCase());
}
} else {
letra[i] = letra[i].replace(letra[i], letra[i].toUpperCase());
}
tmp += letra[i];
}
document.getElementById(id).value = tmp;
}
<input onkeyup="c('input-1')" required class="inp_editar" type="text" name="nome_cont" id="input-1"/>
Obg!