Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 选择数组中存在值的所有复选框_Jquery - Fatal编程技术网

Jquery 选择数组中存在值的所有复选框

Jquery 选择数组中存在值的所有复选框,jquery,Jquery,我在一个div中有一组复选框。下面是一个示例: <input id="customer426693" name="customers" type="checkbox" class="filled-in form-check-input customerCheckbox customerRequired" value="426693"> 我的javascript函数中还有一个要选择的值数组。是否有一种优雅的方法可以使用jquery选择数组中存在值的所有复选框 谢谢。这就是你想要的吗

我在一个div中有一组复选框。下面是一个示例:

<input id="customer426693" name="customers" type="checkbox" class="filled-in form-check-input customerCheckbox customerRequired" value="426693">
我的javascript函数中还有一个要选择的值数组。是否有一种优雅的方法可以使用jquery选择数组中存在值的所有复选框

谢谢。

这就是你想要的吗

var selectedList=[3,4,6]; 函数MakeSelected{ $checkBoxContainer.findinput.eachfunctionindex,项{ 如果$item.datacustomerid>=0,则选择了List.indexOf$item.datacustomerid>=0 $item.propchecked,true; }; } 我删除了类以使其更具可读性。

1. 2. 3. 4. 5. 6.
试试看!给我们看看你的代码。你的意思是检查值了吗?谢谢,很好。