function getText(el)
{
if ('string' == typeof el.textContent) return el.textContent;
if ('string' == typeof el.innerText) return el.innerText;
return el.innerHTML.replace(/<[^>]*>/g,'');
}
function setText(el,str)
{
if ('string' == typeof el.textContent)
el.textContent = str;
if ('string' == typeof el.innerText)
el.innerText = str;
}
No comments:
Post a Comment