I want to set the value of my input text using jquery. I have tried by doing this :
<div class="editor-label">
@Html.LabelFor(model => model.ID )
</div>
<div class="editor-field">
@Html.EditorFor(model => model.ID)
@Html.ValidationMessageFor(model => model.ID)
</div>
and jquery syntax :
$("#ID").val(data.ID);
But it is not working. I have tried the same jquery code with this :
<input type="text" id="ID" />
This approach is working , but I don't know why @Html.EditorFor is not working with jquery .Thanks in advance