Quote:
Originally Posted by VIPStephan
Apparently there is no way to check for the attribute, not for the state. Thanks for your thoughts, though.
|
that’s due to the DOM, where every HTML element adheres to a given Interface. thus the DOM representation of the HTML element holds all possible attributes (resp. their JavaScript equivalents) with either the default values (as given in the DTD) or the values read from the source code. bear in mind that the document tree you work with in JavaScript is not a one-to-one representation of the HTML source code.
PS. in JS, there is no need to check for the attribute, the state suffices as the browser doesn’t render the source code, but the document tree.