Tab关注以下元素在Mozilla中不起作用:
<div class="editor-field">
<div>
<%: Html.TextBox(model => model.AddressLine1, new { maxLength = 30, style = "width:300px", tabindex = "0" })%>
</div>
<div class="editor-field">
<div>
<%: Html.TextBox(model => model.AddressLine2, new { maxLength = 30, style = "width:300px", tabindex = "0" })%>
</div>
<div class="editor-field">
<div>
<%: Html.TextBox(model => model.AddressLine3, new { maxLength = 30, style = "width:300px", tabindex = "0" })%>
</div>
我的CSS是:
editor-field > div > input:focus
{
outline: 1px dotted red !important;
}
我可以知道我哪里错了。默认选项卡导航在Mozilla Firefox中不起作用。在Chrome和IE中运行良好。请帮我解决这个问题。
答案 0 :(得分:0)
您必须使用Jquery或Javascript来设置焦点,如: -
$(document).ready(function() {
$('.editor-field').first().children().children('input').focus();
});