Multiple choice xhtml

Which of the following is the right use of the lang attribute?

  1. <div lang="en" xml:lang="en">Hello World!</div>

  2. <div xml:language="en">Hello World!</div>

  3. <div language="en">Hello World!</div>

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

For XHTML documents that serve as XML (application/xhtml+xml), the xml:lang attribute is required for language declaration. For compatibility with HTML user agents, both lang (HTML) and xml:lang (XML) should be specified. Option B uses xml:language which doesn't exist, and option C uses 'language' which isn't a valid attribute.