用id获取select的value,和用name获取select的value,为什么用id就是undefined?是因为mvc,这个 option的原因吗?
js:
$("#InType").on("change", function () {
console.log($("#Intype").val());
console.log($("select[name='InType']").val());
})
cshtml:
<select id="InType" name="InType" class="span12">
@Html.Raw(ViewBag.InType)
</select>