I have this code which works:
for (let b of buttons) {
b.disabled = true;
}
However, this one won’t:
for (let b of [buttons, searchBtn]) {
b.disabled = true;
}
Meaning, I wanted to add an additional button into an array of them dynamically.
Only searchBtn
will get disabled.
Why? How to fix it?