Selected listbox item as undefined
问题 <script> $(function () { $("select[name='CusList']").removeAttr('multiple'); $("select[name='CusList']").attr('size', '8'); $("select[name='CusList']").find('option:first').attr('selected', 'selected'); //fx(); }); function fx() { var resid = $("select[name='resourcename']").val(); alert(resid); } </script> @Html.ListBox("CusList", ((List<SelectListItem>)ViewData["Customer"]), new { @class = "k-list"}) I tried to call fx() from the pageload(on controller) and also inside the function(). Both