lundi 21 juin 2021

why are my if and else if statements not running?

same as title.

  const inputs =document.querySelectorAll('input');
  inputs.forEach(function(_inputs){
    _inputs.readOnly = !_inputs.readOnly;

    if(_inputs.readyOnly == false){
      _inputs.classList.remove("readOnlyItem")
      _inputs.classList.add("notReadOnly")
    }else if(_inputs.readyOnly == true){
      _inputs.classList.add("readOnlyItem")
      _inputs.classList.remove("notReadOnly")
    }
  });

As far as I can tell every thing seems right and should be working but the if statments never return true for some reason.

Aucun commentaire:

Enregistrer un commentaire