scala-js/scala-js-dom

innerText property not present on Element

mseddon opened this issue · 6 comments

Is this an unintentional omission?

Dunno. Is it a standard property on Element in chrome/firefox/ie? If so we
could add it

On Tue, Apr 22, 2014 at 11:11 AM, mseddon notifications@github.com wrote:

Is this an unintentional omission?


Reply to this email directly or view it on GitHubhttps://github.com//issues/19
.

Looks like it's not present in firefox

http://stackoverflow.com/questions/1359469/innertext-works-in-ie-but-not-in-firefox

Which means you probably shouldn't be using it anyway.

On Tue, Apr 22, 2014 at 11:13 AM, Haoyi Li haoyi.sg@gmail.com wrote:

Dunno. Is it a standard property on Element in chrome/firefox/ie? If so we
could add it

On Tue, Apr 22, 2014 at 11:11 AM, mseddon notifications@github.comwrote:

Is this an unintentional omission?


Reply to this email directly or view it on GitHubhttps://github.com//issues/19
.

Aha, I just had a read and learned something... It works on some browsers (and has worked for as long as I remember), but in fact predates the DOM spec, but it is not actually standard- just ran into an irritating 'feature' of IE8, which doesn't understand textContent (hence my instinct to use innerText). I can obviously just work around with dynamic. I guess since it's a crufty old browser, and it's not technically in the spec, I should close this one.

Ah =( Working with old versions of IE is unfortunately difficult, and trying to do clever old-browser-compatibility-tricks is probably beyond the scope of this library.

I agree. Besides, the longer people cater for ancient IE, the longer it'll stay around :), happy to close given it's not in the spec.

innerText is now supported by all modern browsers:

This feature was originally introduced by Internet Explorer, and was formally specified in the HTML standard in 2016 after being adopted by all major browser vendors.

https://developer.mozilla.org/en-US/docs/Web/API/Node/innerText