This question already has an answer here:
I'm trying a simple code where I set checkBoxElement.checked=true;
, but it doesn't make the checkboxes appear as checked.
What is going on?
#these classes are for my own purposes, and I've checked they exist and the elements are returned
checkBosClass = 'feature-enabled-checkbox';
key = 'some_type_of_box';
#getting the elements and setting "checked"
document.getElementsByClassName(checkBoxClass + " " + key).checked = true;
Aucun commentaire:
Enregistrer un commentaire