如何使用 HTML 中的製表順序(製表鍵盤按鈕)來指定元素的使用?


在 HTML 中使用 tabindex 特性來設定元素的製表順序。它讓你可以在鍵盤上更改 TAB 使用的順序。

你可以嘗試執行以下程式碼來在 HTML 中建立元素的製表順序 −

示例

直接試用

<!DOCTYPE html>
<html>
   <body>
      <a href = "https://tutorialspoint.tw/current_affairs/index.htm" tabindex="1">Current Affairs</a>
      <br>
      
      <a href = "https://tutorialspoint.tw/codingground.htm" tabindex="2">Coding Ground</a>
      <br>
      
      <a href = "https://tutorialspoint.tw/verbal_ability/index.htm" tabindex="4">Verbal Ability</a>
      <br>
      
      <a href = "https://tutorialspoint.tw/quantitative_aptitude/index.htm" tabindex="3">Quantitative Aptitude</a>
      <br>
      
      <p>We have changed the tab order above. Use TAB on keyboard to view the changes.</p>
   </body>
</html>

更新日期:2019-07-30

已瀏覽 162 次

開啟您的職業生涯

透過完成課程獲得認證

立即開始
廣告
© . All rights reserved.