Answers for "como pegar o texto dentro do imput js"

0

como pegar o texto dentro do imput js

var form = document.getElementById('formulario');
var campo = document.getElementById('campo');

form.addEventListener('submit', function(e) {
    // alerta o valor do campo
    alert(campo.value);

    // impede o envio do form
    e.preventDefault();
});
Posted by: Guest on October-22-2021

Code answers related to "como pegar o texto dentro do imput js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language