When I try to do this:
document.getElementById('idOfCheckBox').disabled = disabled; I get error : disabled is undefined.
What can be the reason?
When I try to do this: document.getElementById(‘idOfCheckBox’).disabled = disabled; I get error : disabled
Share
Have you tried to see what
document.getElementById('idOfCheckBox')gives you? Is it a HTMLDOMElement with an attribute disabled? If not, maybe you got the wrong element?Try
console.log(document.getElementById('idOfCheckBox'))if you have access to a fairly modern browser.