如何使用 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>
廣告