【发布时间】:2021-07-04 23:30:04
【问题描述】:
我有两个无线电组,当我获得第一组检查值时,我无法使用以下代码在同一索引处设置另一个组:
$('input[name="service_type[]"]:checked').each(function(index) {
$("input[name=service_type1["+index+"]]").attr('checked', 'checked');
});
语法错误,无法识别的表达式:input[name=service_type1[0]]
two input radio button groups named Single and Return
$service.='<input type="radio" id="str"'.$i++.'"
name="service_type1[]"
class="radio-input return"
value="'.$request->service_type.'">';
$service.='<input type="radio" id="st"'.$i.'"
name="service_type[]"
class="radio-input single"
value="'.$request->service_type.'">';
【问题讨论】:
-
同时显示 html 代码。
-
@Swati 问题已更新
-
所以您需要检查所有其他 divs 轿车、房地产 ..etc 中的相同收音机?
-
如果单选同一辆车,我想检查返回按钮
-
你可以试试this。
标签: jquery