When I was younger and fantasizing about being a 1337 h4x0r, I had no idea there was any room for confusion or controversy in any arena of software development. It all seemed so straightforward ...
And here we've spawned over 120 posts about the continuing relevance of a standard that was ultimately not terribly relevant to begin with.
To paraphrase the W3C validator's response: "Puke".
That being said, I just learned something new: that one can use the ID attribute as a variable name. Thank you very much. (Also works in XHTML; I just checked.)
Last edited by Mr Initial Man; 09-29-2012 at 04:13 PM.
It means that you'll most probably have to revise your last statement and check back your code for errors.
p.s.: I guess "element's ID" is not being used as a "variable name", but as what it really is: a declared public reference to it.
The element's ID can only be directly used as a declared public reference in a .html or .xhtml file. If it is used in a file with any other markup extension (.xml, .svg), then this means of referring to it is only supported by Internet Explorer.
...(.xml, .svg), then this means of referring to it is only supported by Internet Explorer.
well, that's my boy... //others should follow!
Anyway, for cross-browser compatibility, you can always try my underDot platform which is faster than "document.getElementbyId", and smokes any "$()" based functions while being the shortest lib in existence, (weighting less than 40 bytes); using a simple syntax such as: _.elementID; including wrong id definitions: _["element ID"] possibility;
alas, I would never bother to serve my content in other than *.htm anyway.
Bookmarks