18 Sep 2007, 12:38 PM
|
Karamasoft
Joined on 09-05-2004
Posts 5,325
|
|
|
|
Internet Explorer provides an innerText property to get or set the text between the start and end tags of the object. Firefox does not provide an innerText property but a textContent property to get or set the inner text. For the browsers that do not provide a property to get or set the inner text, you can clear the HTML tags inside the innerHTML property. function GetInnerText(elem) { return (typeof(elem.innerText) != 'undefined') ? elem.innerText : ( typeof(elem.textContent) != 'undefined') ? elem.textContent : elem.innerHTML.replace(/<[^>]+>/g, ''); }
|
|
|
|
|
|
|
|
|