【问题标题】:bootstrap-multiselect, getting selected text引导多选,获取选定的文本
【发布时间】:2017-01-24 00:23:32
【问题描述】:

如何在 bootstrap-multiselect 中获取选中的文本。

在onChange函数中,自带值,我使用时的文字

var selectedText = $( "#id_multiSelect option:selected" ).text();

它显示所有选择的内容,没有任何空格。

【问题讨论】:

    标签: bootstrap-multiselect


    【解决方案1】:

    您可以迭代选定的选项。

    这是一个例子:

    $("#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
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-12-29
      • 1970-01-01
      • 1970-01-01
      • 2018-07-04
      • 1970-01-01
      • 2014-12-20
      • 1970-01-01
      • 2019-09-29
      相关资源
      最近更新 更多