gpt4 book ai didi

Jquery 检查选​​择框是否被选中

转载 作者:行者123 更新时间:2023-12-01 01:23:06 24 4
gpt4 key购买 nike

我有 3 个选择框:

<div class="widget mm_select">
<label for="ctrl_Customers_Region">Region</label> <select name="Customers_Region" id="ctrl_Customers_Region" class="select"><option value="">No filtering</option><option value="emea" selected="">EMEA</option><option value="america">America</option><option value="apac">APAC</option><option value="global">Global</option></select></div>

<div class="widget mm_select ">
<label for="ctrl_Customers_Branche">Business</label> <select name="Customers_Branche" id="ctrl_Customers_Branche" class="select"><option value="">No filtering</option><option value="retail-fashion">Retail - Fashion</option><option value="retail-consumer-electronics">Retail - Consumer Electronics</option><option value="retail-digital-goods">Retail - Digital Goods</option><option value="retail-furniture">Retail - Furniture</option><option value="retail-other">Retail - Other</option><option value="manufacturing-automotive">Manufacturing - Automotive</option><option value="manufacturing-pharmaceuticals-chemicals">Manufacturing - Pharmaceuticals / Chemicals</option><option value="manufacturing-high-tech">Manufacturing - High-Tech</option><option value="manufacturing-other">Manufacturing - Other</option><option value="utilities-and-telco-utilities">Utilities and Telco - Utilities</option><option value="utilities-and-telco-telco">Utilities and Telco - Telco</option><option value="food-grocery-and-equipment">Food - Grocery and Equipment</option><option value="media-entertainment-and-publishing">Media, Entertainment, and Publishing</option><option value="b2b-and-distribution">B2B and Distribution</option></select></div>

如何检查是否选中了 3 个选择框中的任何一个?

谢谢

最佳答案

您可以找到被选中但没有值“”的选项:

 if($('select option:selected[value!=""]').length ) { 
//more than one select box is selected
}

关于Jquery 检查选​​择框是否被选中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29896677/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com