发布网友 发布时间:2022-04-22 06:00
共4个回答
热心网友 时间:2022-04-23 06:41
纯JS
var e = document.getElementById("form-field-select-4");JQuery
热心网友 时间:2022-04-23 07:59
http://www.jb51.net/article/42523.htm
热心网友 时间:2022-04-23 09:33
纯JS
var e = document.getElementById("form-field-select-4");alert(getSelectValues(e));// Return an array of the selected opion values;// select is an HTML select element;function getSelectValues(select) {;var result = [];var options = select && select.options;var opt;for (var i=0, iLen=options.length; i<iLen; i++) {opt = options[i];if (opt.selected) {result.push(opt.value || opt.text); } } return result;}热心网友 时间:2022-04-23 11:25
$(#+select标签的id) 不就OK了吗