HTML DOM tabIndex 屬性
定義和用法
tabIndex 屬性可設(shè)桌返回下拉列表中的 tab 鍵控制次序。
語(yǔ)法
selectObject.tabIndex=number
實(shí)例
下面的例子將顯示出一個(gè)文本框和一個(gè)下拉列表的 tab 鍵控制次序:
<html> <head> <script type="text/javascript"> function showTabIndex() { var email=document.getElementById('email').tabIndex
; var sex=document.getElementById('sex').tabIndex
; document.write("Tab index of email field: " + email); document.write("<br />"); document.write("Tab index of dropdown list: " + sex); } </script> </head> <body> <form> Email: <input type="text" id="email" tabindex="1" /> <br /> Sex: <select id="sex" tabindex="2"> <option>Male</option> <option>Female</option> </select> <br /><br /> <input type="button" onclick="showTabIndex()" value="Show tabIndex" /> </form> </body> </html>