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

Is innerHTML standards compliant?

Posted on 2008-06-19
Last Modified: 2013-11-19
I read that innerHTML is "non W3C DOM" and I have no idea what that means....


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">

Open in new window

Question by:hankknight
  • 2
LVL 49

Expert Comment

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

Accepted Solution

Zippit earned 300 total points
ID: 21824530
from www.w3schools.com:

innerHTML is not a part of the W3C DOM specification. However, it is supported by all major browsers.
LVL 16

Author Comment

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

Assisted Solution

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

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