<div class="form-group">
<label>Faculty Name *</label>
@Html.TextBoxFor(i => i.FacultyName, new { @class = "form-control", @placeholder = "Technician e.t.c", @name = "txtfacultyname" })
@Html.ValidationMessageFor(i => i.FacultyName, "", new { @class = "error" })
</div>
<div class="form-group">
<label>EmailAddress *</label>
@Html.TextBoxFor(i => i.EmailAddress, new { @class = "form-control", @placeholder = "[email protected]", @name = "txtemailaddress" })
@Html.ValidationMessageFor(i => i.EmailAddress, "", new { @class = "error" })
</div>
在我的代碼我這樣做:如何設置側重於在頁面加載「系名稱」文本框中以下剃刀代碼
$(document).ready(function() {
$(".form:first").focus();
});
更好地利用'$( '形式控制]名稱= 「txtfacultyname」]。')聚焦(); –