按下标签时跳过输入 [英] Skip input when press tab

查看:101
本文介绍了按下标签时跳过输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表单,其中有三个输入框,旁边有三个下拉选择标签。我希望能够按Tab键并从一个输入转到另一个输入,但必须按两次,因为它会进入输入框后的下拉菜单。有没有一种方法可以让它跳过下拉菜单,然后在按下tab键时直接进入下一个输入框?

I have a form where there are three input boxes with three drop down select tags beside them. I want to be able to press the tab key and go from one input to another, but you have to press it twice because it goes to the drop down menu after the input box. Is there a way I can make it "skip over" the drop down menu and go right to the next input box when you press tab?

推荐答案

您可以通过设置 [tabindex] 属性

without [tabindex]

You can specify the tabbing order explicitly by setting the [tabindex] attribute:

<input type="text" />     <!-- first -->
<input type="checkbox" /> <!-- second -->
<select>...</select>      <!-- third -->



[tabindex]

with [tabindex]:

<input type="text" tabindex="1" />      <!-- first -->
<input type="checkbox" tabindex="3" /> <!-- third -->
<select tabindex="2">...</select>      <!-- second -->

这篇关于按下标签时跳过输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆