WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Use of 'lang' attribute?

for

From: Graham Armfield
Date: Nov 2, 2015 12:31PM


Looks to me as though the developer has been stuffing useful auxiliary
information into the attribute without appreciating what the attribute is
really for.

With HTML5 doctype, this sort of information could be in data- attributes,
but perhaps this dates from HTML4 doctype days when data- attributes would
trigger validation errors.

Regards
Graham Armfield
On 2 Nov 2015 18:50, "Joseph Sherman" < <EMAIL REMOVED> > wrote:

> Is there any other use of the 'lang' attribute besides specifying language?
> I am looking at a web application that uses the 'lang' attribute all over
> the place. Most all elements have 'lang', for example, here's a row of
> table headers:
>
> <tr><th lang="isSelected" rowspan="1" colspan="undefined"><span
> class="headerText">Selected</span></th><th class="alt sortable"
> lang="employee" rowspan="1" colspan="undefined"><span
> class="headerText">Last / First</span></th><th class=" sortable"
> lang="payroll" rowspan="1" colspan="undefined"><span
> class="headerText">EMPL ID</span></th><th class="alt sortable"
> lang="totalHoursWorked" rowspan="1" colspan="undefined"><span
> class="headerText">Total Worked Hours</span></th><th class=" sortable"
> lang="totalPaidAbsences" rowspan="1" colspan="undefined"><span
> class="headerText">Total Paid Absences</span></th>
>
> Even the login form password field has it: <td class="localize"
> lang="password">Password</td>
>
> Is there any reason for this? Can it confuse a screen reader or is it
> harmless?
>
> Joseph
>
> > > > >