jquery 获取select 选中的值

1.根据name

$("select[name='deptId'] option:selected").val();

2.根据id

var hos = $("#hospitalId option:selected").val();

你可能感兴趣的:(前端,select)