HTML的tabindex属性可以设定table键所走的位置,看例子中的table键就是按照事先设定好的顺序走的,tabindex的值不一定要连续,只要是正整数数就行:
一个例子:
使用tabindex属性,当txt3为焦点时触发onfocus事件:
<br>//tabindex不可为负值,也不可为小数值
<input type=text value=-10 tabindex="-10"><input type=text value=1 tabindex=1>
<input type=text value=4 tabindex=4>
<input type=text value=5 tabindex=5><input name=txt3 type=text value=3 tabindex=3 onfocus=alert()>
<input type=text value=2 tabindex=2>