I have an input text which is this:(我有一个输入文本是这样的:)
<div class="editor-label">
@Html.LabelFor(model => model.EmployeeId, "Employee Number")
</div>
<div class="editor-field textBoxEmployeeNumber">
@Html.EditorFor(model => model.EmployeeId)
@Html.ValidationMessageFor(model => model.EmployeeId)
</div>
Which produce following html(哪些产生以下HTML)
<div class="editor-label"> <label for="EmployeeId">Employee Number</label> </div> <div class="editor-field textBoxEmployeeNumber"> <input class="text-box single-line" data-val="true" data-val-number="The field EmployeeId must be a number." data-val-required="The EmployeeId field is required." id="EmployeeId" name="EmployeeId" type="text" value="" /> <span class="field-validation-valid" data-valmsg-for="EmployeeId" data-valmsg-replace="true"></span> </div>
I want to set the value of this input text using jquery so i did this:(我想使用jquery设置此输入文??本的值,所以我做到了:)
<script type="text/javascript" language="javascript">
$(function() {
$('.textBoxEmployeeNumber').val("fgg");
});
</script>
however, it is not working... what is the error in my syntax?(但是,它不起作用...我的语法有什么错误?)
ask by raberana translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…