Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Is innerHTML standards compliant?

Posted on 2008-06-19
4
202 Views
Last Modified: 2013-11-19
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

0
Comment
Question by:hankknight
  • 2
4 Comments
 
LVL 49

Expert Comment

by:Roonaan
ID: 21824521
Even when it is non W3C DOM about every major browser supports it. Why not use it?
0
 
LVL 7

Accepted Solution

by:
Zippit earned 300 total points
ID: 21824530
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
 
LVL 16

Author Comment

by:hankknight
ID: 21824581
Is there a W3C approved alternative?
0
 
LVL 49

Assisted Solution

by:Roonaan
Roonaan earned 200 total points
ID: 21824652
Probableto manually parse all childnodes...
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question