Welcome, Guest. Please Login or Register.
YaBB - Yet another Bulletin Board
09/06/10 at 08:18:58
News: We've upgraded to YaBB 2!
Home Help Search Login Register


Pages: 1
Reply Send Topic Print
Easiest way to do innerText/textContent? (Read 370 times)
HDForMe
YaBB Newbies
*


I Love YaBB 2!

Posts: 10
Easiest way to do innerText/textContent?
03/20/09 at 11:32:14
 
I've read that IE supports innerText and most others support textContent.  Which is a pain.  What is the easiest way to get the inner text from an element that works in any browser?
Back to top
 
 
  IP Logged
HDForMe
YaBB Newbies
*


I Love YaBB 2!

Posts: 10
Re: Easiest way to do innerText/textContent?
Reply #1 - 04/08/09 at 10:08:18
 
Ok, after looking around it looks like this is a pretty simple way:
 
elem.innerText || elem.textContent
 
Seems to work great in IE7 as well as Firefox.
Back to top
 
 
  IP Logged
Pages: 1
Reply Send Topic Print