I am at my end, and this is probably something really simple. I basically have this code:
var menuitem = document.getElementById('mymenuitem');
alert(menuitem);
alert(varImChecking == null);
menuitem.setAttribute('disabled', (varImChecking == null) ? 'true' : 'false');
It should disable the menu item "mymenuitem", but has no effect. When the warning starts, they say: "[XulElement Object]”, followed by "true". I know that getElementById selects the correct menuitem element because onclick bindings to the menuitem variable work.
Some alternatives I've tried:
menuitem.setAttribute('disabled', (varImChecking == null));
menuitem.disabled = (varImChecking == null);
So why does setAttribute not matter? It does not even obscure the menu item. Is there any other way I have to do this?
Edit: Forgotten, the console does not display warnings or errors.