如何使用所选项目显示多选下拉列表

时间:2018-03-14 06:12:38

标签: jquery

我通过这种方式使用多选下拉

T1
+-----+------+
| Ind | Val  |
+-----+------+
|  1  |  aa  |
|  2  |  bb  |
+-----+------+

T2
+-----+------+
| Ind | Val  |
+-----+------+
|  1  |  aa  |
|  2  |  bb  |
|  3  |  cc  |
+-----+------+

Result:
+-----+------+
| Ind | Val  |
+-----+------+
|  3  |  cc  |
+-----+------+

当我们尝试显示带有选中的项目,然后在文本框中显示项目但显示为已选择的项目。如何在下拉列表的文本框中显示所选项目?如何使用角度js?我的脚本如下 -

<script>
$('.multipleSelect').fastselect();
</script>

参考链接为See the reference demo

1 个答案:

答案 0 :(得分:0)

$("#EditmultipleSelect option[value='" + valArr[i] + "']").attr("selected","selected");
相关问题