Write the shortest text getter/setter on an element for the DOM
JavaScript (167)

function t(e,h,f){if(h||h==''){while(f=e.lastChild)e.removeChild(f);e.appendChild(document.createTextNode(h))}h=e.data||'';for(c in f=e.childNodes)h+=t(f[c]);return h}


Usage :

var textContent = t(yourElement); // get the text content
t(yourElement, ''); // clear
t(yourElement, newText); // sets a new text


Note that there is no pollution of the global namespace

Demonstration, with a multi-level DOM tree and a few tests