[whatwg] HTML: A DOM attribute that returns the language of a node

Peter Occil poccil14 at gmail.com
Tue Apr 23 01:44:32 PDT 2013


I believe there should be a DOM attribute that returns the language of a node, as defined in section 3.2.3.3 "The lang and xml:lang attributes".

While there is a "lang" DOM attribute, it's inadequate because it's only affected by the element's "lang" content attribute.  Also, I don't see a way to get the "language of a node" otherwise, especially since it depends not only on "lang" and "xml:lang", but also on the HTTP Content-Language header, which may not be possible to retrieve with existing JavaScript methods, as far as I can tell.

--Peter


More information about the whatwg mailing list