Treat element.disabled as a boolean, instead of comparing against a boolean.
check against null, as @gauthierm suggests