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

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

724 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