2 var documentElement = document.documentElement;
3 if ("textContent" in documentElement) {
4 dom.setTextContent = function(element, text) {
5 element.textContent = text;
8 dom.getTextContent = function(element) {
9 return element.textContent;
11 } else if ("innerText" in documentElement) {
12 dom.setTextContent = function(element, text) {
13 element.innerText = text;
16 dom.getTextContent = function(element) {
17 return element.innerText;
20 dom.setTextContent = function(element, text) {
21 element.nodeValue = text;
24 dom.getTextContent = function(element) {
25 return element.nodeValue;