如何在bootstrap-multiselect中获取所选文本。
在onChange函数中,它附带了值,当我使用
var selectedText = $( "#id_multiSelect option:selected" ).text();它显示所有选定的,不留任何空格。
发布于 2017-01-23 23:19:01
您可以迭代选定的选项。
下面是一个示例:
$("#id_multiSelect option:selected").each(function() {
console.log(this.text); //this will give you the selected text values one by one ... to get value use this.value in place of this.text
});https://stackoverflow.com/questions/37103966
复制相似问题