Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery UI API – :focusable Selector

jQuery UI API - :focusable Selector

Category

Selectors | UI Core

Usage

**Description:** Select elements that can be focused.

jQuery( ":focusable" )

Some elements are focusable by nature, while others require an explicit tab index to be set. In both cases, an element must be visible in order to be focusable.

Elements of the following types are focusable if they are not disabled:input、select、textarea、button and object. Anchors are focusable if they have a href or tabindex attribute.area Elements are focusable if they are within a named map, have a href attribute, and there is a visible image using that map. All other elements are focusable based solely on tabindex their attributes and visibility.

Note: Elements with a negative tab index are :focusable, not :tabbable。

Example

Select focusable elements and highlight them with a red border.









  

  :focusable Selector 实例

  

  

  

  





 

不带有 href 的锚
带有 href 的锚

不带有 tabindex 的段落

带有 tabindex 的段落