Sets or retrieves the index that defines the tab order for the object.
HRESULT IHTMLElement2::get_tabIndex(short *p);HRESULT IHTMLElement2::put_tabIndex(short v);
- Pointer to a variable of type short that receives the tab index.
- short that specifies the tab index.
Returns S_OK if successful, or an error value otherwise.
The IHTMLElement2::tabIndex value determines the tab order as follows:
- Objects with a positive IHTMLElement2::tabIndex are selected in increasing tab index order and in source order to resolve duplicates.
- Objects with an IHTMLElement2::tabIndex of zero are selected in source order.
- Objects with a negative IHTMLElement2::tabIndex are omitted from the tabbing order.
An element can have focus if the IHTMLElement2::tabIndex property is set to any valid negative or positive integer.
The following elements can have focus by default but are not tab stops. These elements can be set as tab stops by setting the IHTMLElement2::tabIndex property to a positive integer. applet, div, frameSet, span, table, td.
Elements can become part of the accessibility hierarchy if the TABINDEX attribute is set as follows:
- For Microsoft Internet Explorer 5.01 and later, set the TABINDEX attribute to any value.
- For Internet Explorer 5, set the TABINDEX attribute to a positive value.
For Internet Explorer 5.01 or above, the attribute may be set to any value in the valid range of
Content of elements with a closing tag can have focus by default, but are not tab stops. As of Internet Explorer 5, you can set the IHTMLElement2::tabIndex property to a valid positive integer to force the content to have a tab stop.