Is there any reason to prefer




function setTextValue(el, t) {
while (el.hasChildNodes()) {
el.removeChild(el.lastChild);
}
...