标签到< select>输入元素在html [英] tab to <select> input element in html

查看:107
本文介绍了标签到< select>输入元素在html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表单,其中有几个输入选择元素。我的问题是,我可以使用标签在输入元素之间移动,但不能使用选择下拉菜单。我试过 tabindex =2属性,但它并没有影响任何东西。

I have a form, and within it several input and select elements. My problem is that I can use tab to move between input elements, but not the select drop down menu. I tried tabindex="2" attribute, but it didn't affect anything.

有没有办法这个?

这是我的代码示例。如果它改变了我在php中的任何东西,但是我无法在html ether中找到它。

Here is a sample of my code. If it changes anything I'm in php, but I'm not able to get it to tab in html ether.

<table>
    <tr>
        <td>
        <select>
            <option value="volvo">Volvo</option><option value="saab">Saab</option><option value="mercedes">Mercedes</option><option value="audi">Audi</option>
        </select></td><td>
        <input type="text" name="location" size=17 maxlength=22/>
        </td><td>
        <input type="text" name="date" size=12 maxlength=10/>
        </td>
    </tr>
</table>

我希望我发布了这个版本,我很难用代码。

I hope I posted this right I'm have a hard time with the code.

推荐答案

在Firefox上,例如,选择 a href =http://cafe.bg14.com/purchases.php =nofollow> http://cafe.bg14.com/purchases.php 可以标签到,它只是在标签顺序的晚期。原因是您为某些表单字段但不是全部设置 tabindex 属性。没有属性的那些人将会来。

On Firefox, for example, the select element on your real life sample page http://cafe.bg14.com/purchases.php can be tabbed to, it’s just late in the tabbing order. The reason is that you are setting tabindex attribute for some form fields but not all. Those without the attribute will come last.

删除所有 tabindex 属性(如果自然选项顺序,按顺序在HTML标记中,可以),或者将它们用于应该参与制表的所有字段和其他项目。

Either remove all tabindex attributes (if the natural tabbing order, by order in HTML markup, is OK), or use them for all fields and other items that should participate in tabbing.

您还应使用HTML W3C验证器修复标记,在决定要使用哪个版本的HTML之后。该页面现在声明XHTML 1.0,但使用未引用的属性值和HTML5功能。这使得更难看出存在严重的标记错误,如 th 元素未包含在 tr 元素内。 (打破HTML表模型可能会对渲染和功能产生影响。)

You should also fix the markup, using HTML W3C validator, after deciding which version of HTML you wish to use. The page now declares XHTML 1.0 but uses unquoted attribute values and HTML5 features. This makes it more difficult to see that there are serious markup errors, like th elements not wrapped inside a tr element. (Breaking the HTML table model may have an impact on both rendering and functionality.)

这篇关于标签到&lt; select&gt;输入元素在html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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