【发布时间】:2018-04-27 19:48:00
【问题描述】:
我需要根据复选框“继续”。
HTML:
<input type = "text" id = "E1" /><input type="checkbox" id="C1">
<input type = "text" id = "E2" /><input type="checkbox" id="C2">
<input type = "text" id = "E3" /><input type="checkbox" id="C3">
<input type = "text" id = "E4" /><input type="checkbox" id="C4">
JS:
for (var i=1; i<=4; i++) {
if ("$C" +i.checked == true) {continue;}
...;
}
</script>
【问题讨论】:
-
您的意思是如果选中复选框,则再次从零开始?
-
没有。只是没有完成那个迭代。但继续下一项。
-
你不能通过在他们的 id 前加上 $ 来访问你的对象
-
最重要的是:你想达到什么目标?您想在哪里打印该输出?
-
@verlager 你的预期结果是什么?
标签: javascript jquery for-loop