Solved

Is innerHTML standards compliant?

Posted on 2008-06-19
4
199 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

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 (http://www.experts-exchange.com/A_2902.html) 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