效果图:
全选之后获取值:
html代码:
<select multiple="multiple" style="width: 350px" id="sel">
<option selected="selected">To Effective</option>
<option selected="selected">Effective</option>
<option>Expiry</option>
</select>
jquery代码(记得引用jquery.js)
$("#btnSearch").click(function () {
var sel = "";
$("#sel option:selected").each(function () {
//把选中的每个值一起拼成字符串
sel = sel + $(this).val() + "^"
});
alert(sel);
});