Re:Show HN: TopLevel – A New Way to JavaScript Your HTML
by user24 on Thursday June 05, 2014 @03:05AM
(#7850607)
Could a textarea tag work too?
Re:Show HN: TopLevel – A New Way to JavaScript Your HTML
by kristopolous on Thursday June 05, 2014 @03:27AM
(#7850659)
not if the document has an existing <textarea> (and thus </textarea>). <plaintext> is rather final ... see here for a demo I just threw together: http://getpostdelete.com/plaintext.html
The HTML interpreter packs up its bags and goes home - you can't "close" a <plaintext> tag if it's existing in a plain HTML page.
However, you can still manipulate it through the DOM.
I have yet to get it working as reliably across the same wide range of browsers.
As far as it disappearing; In order for that to happen one browser group will have to take the first step of intentionally breaking legacy webpages - it seems antithetical to the "render as much as possible" features arm-race nature of the browser world.
Then again, I've been wrong plenty of times before.