html
--------------------------------------------------------------------------------------
<select id="num">
<option value="0">请选择</option>
<option value="1">111</option>
<option value="2">222</option>
<option value="3">333</option>
<option value="4">444</option>
</select>
jQuery
--------------------------------------------------------------------------------------
方法1:
var val = $(‘#num‘).val();
方法2:
var val = $(‘#num option:selected‘).val();
时间: 2024-10-15 15:16:02