That's actually one big can of worms. Here's a full explanation, if
you're interested —
http://stackoverflow.com/questions/1359469/innertext-works-in-ie-but-not-in-firefox/1359822#1359822
Most robust solution is actually not `textContent` and not
`innerText`, but recursive iteration of children (text) nodes. However
that could be "slow", depending on a context where it is to be used.
It is, of course, possible to feature test all known discrepancies and
craft fast, yet compliant implementation, but the size of such
solution would be rather humongous (see, for example, one of my
(incomplete) attempts —
http://groups.google.com/group/comp.lang.javascript/msg/d1574256dea74077).
As always, it's all about context. If you care about consistent
results, go for recursive iteration or innerHTML + regex tag stripping
(remember that regex would still be fragile). If, on the other hand,
it's all about speed — use textContent/innerText and take care of
discrepancies as needed.
--
kangax