这难道是bug吗?没人解决? 在线等待.......................
解决方案 »
- 基于JQuery的网页虚拟桌面,请各位大侠多提点意见(重发,原帖的资源无法下载)
- min-height 的不兼容
- js时间控件取值---急啊
- qq软件频道以前的焦点为什么把TABLE换成DIV就不正常了
- 如何使用js在站点里按F1 弹出自己的帮助文件,而不是系统自带的
- 高手请进,请问如何用javascript动态修改下拉列表框中的条目
- 简单问题,初学着先谢了
- 中文和一般字符的区分
- 求Web上DHTML做的Tree 节点拖动的示例代码(搜索结果中 孟子E掌提供的参考链接失效了)
- 如何让按钮失效(很菜的问题,实在不好意思问,唉......)
- 请问如何用onchange事件实现对公、母猪比例的计算?onestab(┼─)请进,各位大虾请进
- 国内专业的注册表论坛,欢迎光临。
摘:Tabbing navigation
Attribute definitionstabindex = integer
This attribute specifies the position of the current element in the tabbing order for the current document. This value may be a positive or negative integer.
The tabbing order defines the order in which elements will receive focus when navigated by the user via the keyboard. The tabbing order may include elements nested within other elements. Elements that may receive focus should be navigated by user agents according to the following rules:Those elements that support the tabindex attribute and assign a postive value to it are navigated first. Navigation proceeds from the element with the lowest tabindex value to the element with the highest value. Values need not be sequential nor must they begin with any particular value. Elements that have identical tabindex should be navigated in the order they appear in the document.
Those elements that do not define the tabindex attribute or do not support it are navigated next. These elements are navigated in the order they appear in the document.
Those elements that support the tabindex attribute and assign a negative value to it do not participate in the tabbing order.
Elements that are disabled do not participate in the tabbing order.
The following elements support the tabindex attribute: A, AREA, OBJECT, INPUT, SELECT, TEXTAREA, and BUTTON. In this example, the tabbing order will be the BUTTON, the INPUT elements in order (note that "field1" and the button share the same tabindex, but "field1" appears later in the document), and finally the link created by the A element. <HTML>
<BODY>
...some text...
Click to go to the
<A tabindex="10" href="http://www.w3.org/">W3C Website.</A>
...some more...
<BUTTON type="button" name="get-database"
tabindex="1" onclick="get-database">
Click me to receive the current database.
</BUTTON>
...some more...
<FORM action="..." method="post">
<INPUT tabindex="1" type="text" name="field1">
<INPUT tabindex="2" type="text" name="field2">
<INPUT tabindex="3" type="submit" name="submit">
</FORM>
</BODY>
</HTML>Tabbing keys. The actual key sequence that causes tabbing navigation or element activation depends on the configuration of the user agent (e.g., the "tab" key is used for navigation and the "enter" key is used to activate a selected element). User agents may also define key sequences to navigate the tabbing order in reverse. When the end (or beginning) of the tabbing order is reached, user agents may circle back to the beginning (or end).
Box 3 <input type="text" name="tab2" tabindex="3"><a href="javascript:test()">change</a>
<script language="javascript">
function test(){
//alert(document.all.tab1.tabIndex);
document.all.tab1.tabIndex=-1;
//alert(document.all.tab1.tabIndex);
}
</script>如上代码有效。
这句与MSDN中所述不一致:
The following elements support the tabindex attribute: A, AREA, OBJECT, INPUT, SELECT, TEXTAREA, and BUTTON. 以下摘自MSDN:
The tabIndex value determines the tab order as follows:
(1)Objects with a positive tabIndex are selected in increasing iIndex order and in source order to resolve duplicates.
(2)Objects with a tabIndex of zero are selected in source order.
(3)Objects with a negative tabIndex are omitted from the tabbing order. An element can have focus if the tabIndex property is set to any valid negative or positive integer.The following elements can have focus and are tab stops by default: a, BODY, button, frame, iframe, img, input, isIndex, object, select, textArea.The following elements can have focus by default but are not tab stops. These elements can be set as tab stops by setting the tabIndex property to a positive integer. applet, div, frameSet, span, table, td.还有,tabIndex在其它elements的应用我知道,但我主要想解决“动态设置frame是否能在按TAB键时接收焦点”的问题
如果在script中设置tabIndex实在不可行,可用其它方法