[whatwg] Proposal: Add HTMLElement.innerText

Markus Ernst derernst at gmx.ch
Mon Aug 16 03:58:09 PDT 2010


Am 16.08.2010 11:23 schrieb Maciej Stachowiak:
> 
> - Is it a genuinely useful feature? 
>     Yes, the ability to get plaintext content as rendered is a useful 
> feature and annoying to implement from scratch. To give one very 
> marginal data point, it's used by our regression text framework to 
> output the plaintext version of a page, for tests where layout is 
> irrelevant. A more hypothetical use would be a rich text editor that has 
> a "convert to plaintext" feature. textContent is not as useful for these 
> use cases, since it doesn't handle line breaks and unrendered whitespace 
> properly.

Additionnally, from a humble author's POV, once you learnt that 
innerHTML is now available in the standard, it would be quite intuitive 
to also have innerText.



More information about the whatwg mailing list