Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript enable a button once an input text filled

document.getElementById("name").addEventListener("keyup", function() {
    var nameInput = document.getElementById('name').value;
    if (nameInput != "") {
        document.getElementById('send').removeAttribute("disabled");
    } else {
        document.getElementById('send').setAttribute("disabled", null);
    }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #enable #button #input #text #filled
ADD COMMENT
Topic
Name
5+3 =