Set tabindex to a div accurately using jQuery
===

I have built a control using jQuery:

    <div class="my-control" />
    ...
    $('.my-control').myControl(); // builds it up as a ui element

Presently it is just a bunch of divs, spans, styles, mouse behaviors, etc. It does not get focus or participate in selection by tab.

I am finding the use of tabindex awkward in giving it focus. It is hard to know what value to give it. The control needs to inspect the rest of the document, be aware of other focusable controls, pay attention to when the rest of the document changes, etc.

Is it possible to say focusable=true and let it work out the tab order by document position, as normal?

Are there other techniques for doing this, other than tabindex?

