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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System ( introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

867 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now