Created
November 22, 2024 19:36
-
-
Save desenvolvendositeswp/cb5e5053bb5f48e9615938b411270128 to your computer and use it in GitHub Desktop.
Mascara para input especifico do JetFormBuilder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* copie este código e cole no seu campo html*/ | |
/* Para os textos começarem com letras maiusculas*/ | |
document.addEventListener('DOMContentLoaded', function() { | |
// Substitua 'input-selector' pelo seletor correto do campo que você deseja alterar. | |
const campo = document.querySelector('input[name="seu_input"]'); | |
if (campo) { | |
campo.addEventListener('input', function() { | |
// Converte a primeira letra para maiúscula | |
this.value = this.value.replace(/\b\w/g, function(letra) { | |
return letra.toUpperCase(); | |
}); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment