js select2初始化
时间: 2023-09-24 16:12:17 浏览: 213
select2.js
5星 · 资源好评率100%
在这个代码中,使用了select2插件对下拉列表进行初始化设置。首先,在HTML部分定义了一个select元素,使用了class为"form-control",id为"jgdm_search"。接着,在JavaScript中,通过读取数据源mzlist、gjlist和jglist的值,分别构建了listmz、listgj和listjg的数组对象,其中每个对象包含id和text属性。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [select2 初始化以及设置默认选中值](https://blog.csdn.net/G_zhenyan/article/details/109159760)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [select2 插件初始化方法小记](https://blog.csdn.net/duncan93/article/details/100008581)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文