dimanche 27 décembre 2020

if & else conditios not working in javascript [closed]

<script>
    document.addEventListener('DOMContentLoaded', function() {

        // by default the submit button shd be disabled 

        document.querySelector('#submit').disabled = true;

        document.querySelector('#task').onkeyup = () => {
            if (document.qerySelector('#task').value.length > 0) {
                document.querySelector('#submit').disabled = false;
            } else {
                document.querySelector('#submit').disabled = true;
            }

        }

Aucun commentaire:

Enregistrer un commentaire