获取select框下option所有值

document.getElementById('roomId').options[0].value;获取第一个值

var roomIds = $("#roomId option").map(function(){
return $(this).val();
}).get().join(",");获取所有值并且拼接成字符。

猜你喜欢

转载自www.cnblogs.com/penghq/p/9203219.html
今日推荐