Computer >> 컴퓨터 >  >> 프로그램 작성 >> JavaScript

HTML에서 요소의 탭 순서를 만드는 방법은 무엇입니까?


tabindex 사용 요소의 탭 순서를 설정하는 HTML의 속성. 키보드에서 TAB 사용 순서를 변경할 수 있는 권한을 부여합니다.

예시

HTML에서 요소의 탭 순서를 생성하기 위해 다음 코드를 실행할 수 있습니다 -

<!DOCTYPE html>
<html>
   <body>
      <a href="https://www.tutorialspoint.com/current_affairs/index.htm" tabindex="1">Current Affairs</a><br>
      <a href="https://www.tutorialspoint.com/codingground.htm" tabindex="2">Coding Ground</a><br>
      <a href="https://www.tutorialspoint.com/verbal_ability/index.htm" tabindex="4">Verbal Ability</a><br>
      <a href="https://www.tutorialspoint.com/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>