Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- ...
- <body>
- <input id="cpf"/>
- <button id="cadastrar">Cadastrar</button>
- <script>
- function is_cpf(c) {
- ...
- }
- function habilitarbtn(c) {
- document.getElementById('cadastrar').disabled = !is_cpf(c);
- }
- document.getElementById('cpf').addEventListener('input', function (e) {
- habilitarbtn(e.target.value);
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement