views:

264

answers:

2

Is there any particular reason that it isn't in any of the the specs?

It seems to be supported in all browsers, (although I'll admit it doesn't work right in all of them...since you have to use libraries like innerXHTML to get it to work right thanks to Internet Explorer.

Is innerHTML in danger of disappearing from forthcoming versions of browsers? If not shouldn't they just add it already?

I'm marking this community wiki as I know I'm gonna take a beating on my rep for this...but I just wondered why...

+1  A: 

http://dev.w3.org/html5/spec/Overview.html#innerhtml

There's absolutely no way it's in danger, thousands of applications rely on it and doing so would be a horrible idea.

meder
Sweet. I guess I can use it then.
leeand00
+1  A: 

I'll admit it doesn't work right in all of them...since you have to use libraries like innerXHTML to get it to work right thanks to Internet Explorer.

IE invented innerHTML; you can't really expect it to work any better than it does there.

Is there any particular reason that it isn't in any of the the specs?

It's proposed for HTML5, for what it's worth. There is certainly no danger of it disappearing in the future, though you should continue to use it only for the simple cases where you are writing straight ‘block’ or ‘inline’ element content. Special cases like tables and selects are going to continue to be troublesome.

bobince
is the IE invented innerHTML comment meant to be sarcastic? They certainly invented it, but they failed to implement it on many elements, and it has issues on some of the elements it was implemented on. Since none of these have been fixed in IE7 or IE8 (except the exception in IE8 for tables) I certainly DO expect it to work better than it does in IE... I'd like it to work like it does in all other browsers... on all elements.
scunliffe
@scunliffe Agreed. We're not using the same type of wheel on our cars today that the first caveman that invented it did.
leeand00