[whatwg] accesskey attribute with display:none elements

Olli Pettay Olli.Pettay at helsinki.fi
Tue Nov 25 14:55:21 PST 2008


On 11/26/2008 12:39 AM, Benjamin Hawkes-Lewis wrote:
> Olli Pettay wrote:
>>> Couldn't you style such elements visible with :focus and :active?
>> What you mean? How do you focus a display:none element?
>
> Good point. You can't. Isn't that a problem in practice? i.e. When do
> you want a control to have an accesskey but _not_ be focusable?

For example when you want to execute some JS when accesskey is pressed:
<a accesskey="x" href="javascript:doSomething();">
That behavior is used in the web
https://bugzilla.mozilla.org/show_bug.cgi?id=419059&mark=1#c1
The comment mentions dhtml menus and that is a valid use case for
accesskeys in display:none elements.

-Olli







More information about the whatwg mailing list