‘innerText’ works in IE, but not in Firefox

Update: I wrote a blog post detailing all the differences much better. Firefox uses W3C standard Node::textContent, but its behavior differs “slightly” from that of MSHTML’s proprietary innerText (copied by Opera as well, some time ago, among dozens of other MSHTML features). First of all, textContent whitespace representation is different from innerText one. Second, and … Read more

How can I tell if a DOM element is visible in the current viewport?

Now most browsers support getBoundingClientRect method, which has become the best practice. Using an old answer is very slow, not accurate and has several bugs. The solution selected as correct is almost never precise. This solution was tested on Internet Explorer 7 (and later), iOS 5 (and later) Safari, Android 2.0 (Eclair) and later, BlackBerry, … Read more