// Given the following HTML fragment:
// <div id="divA">This is <span>some</span> text</div>
// Get the text content:
var text = document.getElementById("divA").textContent;
// |text| is set to "This is some text".
// Set the text content:
document.getElementById("divA").textContent = "This is some text";
// The HTML for divA is now <div id="divA">This is some text</div>
textContent returns null if the element is a document, a document type, or a notation.
textContent returns the text inside this node (the nodeValue).
textContent returns the concatenation of the textContent attribute value of every child node, excluding comments and processing instruction nodes. This is an empty string if the node has no children.
Page last modified 15:01, 28 Jul 2007 by Mgjbot