View Single Post
Old 08-26-2010, 03:01 PM   PM User | #8
Dormilich
Senior Coder

 
Dormilich's Avatar
 
Join Date: Jan 2010
Location: Behind the Wall
Posts: 2,907
Thanks: 10
Thanked 293 Times in 289 Posts
Dormilich is on a distinguished road
Quote:
Originally Posted by VIPStephan View Post
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.
__________________
please post your code wrapped in [CODE] [/CODE] tags

Last edited by Dormilich; 08-26-2010 at 03:04 PM..
Dormilich is offline   Reply With Quote