samedi 14 août 2021

Checkbox is Always being checked

I have a checkbox

    <input type="checkbox" name="Vebasto" class="checkbox" value="350" id="Vebasto" />
    <label for="Vebasto">Vebasto</label>

And script that checks if it checked:

  if(document.querySelector('input#cond').checked = true){
    alert("checked");
    }

When page is loading I have got this alert but checkbox in not checked. What's wrong?




Aucun commentaire:

Enregistrer un commentaire