textContent are properties that get or set the text of an element or all its children. Internet Explorer implemented
innerText in version 4.0, and it’s a useful, if misunderstood feature. WebKit also has
innerText, carefully copying from, and even improving upon IE; and additionally has the standards compliant
textContent, which we shall see, is no where near as useful and is in fact quite different. Firefox has
textContent but not
innerText, and a common mistake is writing code that retrieves one or the other, assuming the result will be the same (it’s not). Opera has the property, but it is little more than an alias of
textContent, which to me is analogous to false advertising.
Posts Tagged ‘bug’
While working on the BetterVideo HTML5 player, I came across an odd bug in Safari; Unicode characters weren’t rendering correctly. What I was attempting to do was create a simple close button — a small box with an “x” in it. But I didn’t want to use the “x” character, I wanted something a little more specific. The Unicode character
#&10005 is perfect, and there is a Webdings equivalent of it for Internet Explorer (small case “r”).