如何把js中定义的变量写到input中
<script type="text/javascript">var applytype=0;
if (i==2) applytype=3;
</script>
@using (Html.BeginForm("DynamicInfoApplyHP", "DynamicInfo", FormMethod.Post, new { enctype = "multipart/form-data", id = "infoform", runat = "server" })){
<td colspan="3">
<input type="hidden" name="applytype" value="" />
</td>
该怎么给value赋值呢?