开发者

navigation between fields in html

开发者 https://www.devze.com 2023-02-03 17:21 出处:网络
I have in my page the following eleme开发者_如何学运维nts in sequence: input-textlinkinput-textlink

I have in my page the following eleme开发者_如何学运维nts in sequence:

input-text link input-text link

How to navigate using the tab key from one input to the other input, jumping the links ?


You can control the order in which elements are accessed with the tab key by setting the tabindex property in your elements:

<input type="text" tabindex="1" />

<a href="#" tabindex="3">link</a>

<input type="text" tabindex="2" />

<a href="#" tabindex="4">link</a>

This will cause the first input to receive keyboard-focus first, then the second input followed by the links. Here's a JS Fiddle demo.


I think the tabindex property may be what you're looking for.

0

精彩评论

暂无评论...
验证码 换一张
取 消