Randy Webb wrote:
[...]
IE is not the "standard". Far from it.
If the others are attempting to emulate it, then, in this case, it is.
I was in no way suggesting that IE is *the* standard - heaven forbid!!
Thats a dangerous statement to make. IE does this:
idOfElement.innerHTML;
but no other browser does. Does that mean they all have a bug? No.
No, but the non-standard behaviour of IE is not the topic of the
thread. It's whether other browsers are correctly emulating IE or not.
I guess it's an issue when reverse engineer something - do you
slavishly copy the behaviour, or modify it to create a "better"
version? Either way, you are going to annoy someone - the current
issue being a case in point.
It is moot whether it is more correct for innerHTML to reflect the
actual script, the user-modified script, the programmatically modified
script or even the browser-parsed-and-rendered script. Excellent
arguments are presented above for various cases.
Microsoft does not specify what innerHTML should do in that regard, it
seems to be intended to replace the content of a tag pair, not to read
what is currently there, though that seems to be a common use for it.
So whoever wishes to emulate innerHTML only has IE's behaviour to copy
from, and it returns the user modified value of input elements, not the
original scripted value (unless it hasn't been modified).
<URL:
http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/innerhtml.asp>
"When the innerHTML property is set, the given string completely
replaces the existing content of the object."
There is no statement on what innerHTML should return when "got", it
just says it is accessible.
So whoever wishes to emulate innerHTML only has IE's behaviour to copy
from, and it returns the user modified value of input elements, not the
original scripted value (unless it hasn't been modified).
None of the above should be interpreted as my endorsement of IE as an
official standard; but just one of many facets of this discussion.