Aaron Franke
Aaron Franke

Reputation: 4082

Is "us" a valid language for the lang attribute in HTML?

In the example HTML file that comes with jQuery UI, the html element looks like this:

<html lang="us">

Is this even a valid language to use in the lang field? I thought it had to be en or similar? What kinds of things are valid? Would en-US or similar be valid if you wanted to specify US English? Are some values only compatible with some browsers or systems?

Upvotes: 0

Views: 193

Answers (1)

Quentin
Quentin

Reputation: 944256

Is this even a valid language to use in the lang field?

No, it is not an ISO language code.

Would en-US or similar be valid if you wanted to specify US English?

Yes

Are some values only compatible with some browsers or systems?

Yes. For example, a screen reader might not have a pronunciation guide for zu available (so would revert to a default).

Upvotes: 1

Related Questions