0

我该怎么做?我试过设置tabindex属性无济于事。

4

3 回答 3

5

如果您使用的是 Mac,则需要打开Keyboard首选项面板,切换到Keyboard Shortcuts选项卡并选择:

"press Tab to move the keyboard focus between: (x) All controls"
于 2010-01-20T23:51:21.743 回答
0

请发布您的代码。这是 w3c 的示例(http://www.w3.org/TR/html401/interact/forms.html#h-17.10):

<FORM action="..." method="post">
 <P>
 <FIELDSET>
  <LEGEND>Personal Information</LEGEND>
  Last Name: <INPUT name="personal_lastname" type="text" tabindex="1">
  First Name: <INPUT name="personal_firstname" type="text" tabindex="2">
  Address: <INPUT name="personal_address" type="text" tabindex="3">
  ...more personal information...
 </FIELDSET>
 <FIELDSET>
  <LEGEND>Medical History</LEGEND>
  <INPUT name="history_illness" 
         type="checkbox" 
         value="Smallpox" tabindex="20"> Smallpox
  <INPUT name="history_illness" 
         type="checkbox" 
         value="Mumps" tabindex="21"> Mumps
  <INPUT name="history_illness" 
         type="checkbox" 
         value="Dizziness" tabindex="22"> Dizziness
  <INPUT name="history_illness" 
         type="checkbox" 
         value="Sneezing" tabindex="23"> Sneezing
  ...more medical history...
 </FIELDSET>
 <FIELDSET>
  <LEGEND>Current Medication</LEGEND>
  Are you currently taking any medication? 
  <INPUT name="medication_now" 
         type="radio" 
         value="Yes" tabindex="35">Yes
  <INPUT name="medication_now" 
         type="radio" 
         value="No" tabindex="35">No

  If you are currently taking medication, please indicate
  it in the space below:
  <TEXTAREA name="current_medication" 
            rows="20" cols="50"
            tabindex="40">
  </TEXTAREA>
 </FIELDSET>
</FORM>
于 2010-01-20T23:31:53.477 回答
0

如果你知道这个工作的(最好是简单的)页面,你可能想看看他们的来源。

另外,您确定您的 HTML 文档在尝试时具有键盘焦点吗?我之所以这么问,是因为我似乎记得我可以在纯 HTML 页面中使用 TAB 导航到此类元素,在这些元素中我没有做任何事情来指示标签顺序或类似内容。

于 2010-01-20T23:35:03.607 回答