How will the <ul> element receive a focus event?

I run the following code to track the tagName of each control that receives focus in an HTML document:

$(function() {
    $("*").bind("focus", function() {
        console.log("tabbed " + this.tagName);
    });
});

When this is done, I can look at the firebug console and see its trace tags, such as "A" and "INPUT," which I expect to get in focus when I view the document. However, it also tracks one "UL" tag. The document has several UL tags, and only this UL tag seems to get focus.

Any ideas how this could happen? An UL tag that has focus does not have an attribute (name, identifier, etc.), so I have no idea how it would be changed by another script.

(works in firefox. The page I'm looking at is quite large, so I don’t include the source, but the UL tag has no attributes, it contains some LIs, one of these LIs contains a tag).

According to What HTML Elements Can Get Focus? , possibly because some script installed tabindex for this UL tag. I can not find such a script.

Note that I'm not trying to figure out how to make UL focused, but rather find out why it is orientable.

+5
source share
2 answers

Focus processing is entirely dependent on browser implementation.

Hovewer html-, tabindex, .:

<ul tabindex="1">
    <li>item</li>
    <li>item</li>
</ul>

<ul tabindex="2">
    <li>item</li>
    <li>item</li>
</ul>

"" UL ( )

+10

LI UL A, ( A) UL.

0

All Articles