Home arrow XML arrow Page 2 - XML Responses and AJAX

XML Responses and AJAX

In a previous tutorial we looked at the responseText property of the XMLHTTP Request. This tutorial will focus on the responseXML accessor.

Author Info:
By: Jayaram Krishnaswamy
Rating: 4 stars4 stars4 stars4 stars4 stars / 40
February 27, 2006
  1. · XML Responses and AJAX
  2. · A brief explanation of innerHTML
  3. · AJAX returning an XML document
  4. · A Quick look at XMLDOM
  5. · Student Nodes Collection

print this article

XML Responses and AJAX - A brief explanation of innerHTML
(Page 2 of 5 )

We will be coming across the innerHTML property of a DOM object often. To understand this property, consider the following script. The document's p tag is grabbed by referencing its Id property using the getElementById() method. Make sure the syntax is correct; it is case sensitive and unforgiving. The next statement writes the innerHTML property of the referenced element as well as the InnerText property. The innerHTML property represents everything referenced by the Id reference including the mark up, that is in this case, The is a: monkey, whereas the InnerText property gets all the text after removing other tags, in this case, This is a:  monkey as shown in the next picture.


function explain(){
     var inT = document.getElementById("two");
"inner HTML: " + inT.innerHTML+
"<hr width='40%' align='left'>innerText: "
+ inT.innerText);

<p id="two">This is a:
<input type="button" value="test" onClick="explain()">

blog comments powered by Disqus

- Open XML Finally Supported by MS Office
- XML Features Added to Two Systems
- Using Regions with XSL Formatting Objects
- Using XSL Formatting Objects
- More Schematron Features
- Schematron Patterns and Validation
- Using Schematron
- Datatypes and More in RELAX NG
- Providing Options in RELAX NG
- An Introduction to RELAX NG
- Path, Predicates, and XQuery
- Using Predicates with XQuery
- Navigating Input Documents Using Paths
- XML Basics
- Introduction to XPath

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials