For browsers supporting DOM3 you can use textContent:
document.getElementById("mylink").textContent = new_text;
This works in FF(tested in 3), Opera (tested in 9.6) and Chrome (tested in 1) but not in MSIE7 (haven't tested in MSIE8)
Added example
It's not pretty but should work cross browser (tested in win in FF3, Opera9.6, Crome1 and MSIE7)
function replaceTextContent(element,text) {
if (typeof element ==="string") element = document.getElementById(element);
if (!element||element.nodeType!==1) return;
if ("textContent" in element) {
element.textContent = text; //Standard, DOM3
} else if ("innerText" in element) {
element.innerText = text; //Proprietary, Micosoft
} else {
//Older standard, even supported by Microsoft
while (element.childNodes.length) element.removeChild(element.lastChild);
element.appendChild(document.createTextNode(text));
}
}
(updated: added support for Microsofts proprietary innerText)