Is innerHTML standards compliant?

I read that innerHTML is "non W3C DOM" and I have no idea what that means....

http://www.javascriptkit.com/domref/elementproperties.shtml

Should I use this or is there a better method?  I want to alert the text found in a div.

My code works but I want to make sure it meets standards.
<div id="m52371426">Hello World</div>
<script type="text/javascript">
alert(document.getElementById("m52371426").innerHTML);
</script>

Open in new window

LVL 16
hankknightAsked:
Who is Participating?
 
ZippitConnect With a Mentor Commented:
from www.w3schools.com:
http://www.w3schools.com/htmldom/dom_methods.asp

innerHTML is not a part of the W3C DOM specification. However, it is supported by all major browsers.
0
 
RoonaanCommented:
Even when it is non W3C DOM about every major browser supports it. Why not use it?
0
 
hankknightAuthor Commented:
Is there a W3C approved alternative?
0
 
RoonaanConnect With a Mentor Commented:
Probableto manually parse all childnodes...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.