How to substitute the “0” with “i” in the below line inside for loop in javascript?

How to substitute the "0" with "i" in the below line inside for loop in javascript?

Code:

for (var i = 0, n = checkboxes.length; i < n; i++) {
    e.form.NameLists_0__IsDeleted.checked = false;
}

Answers


for (var i = 0, n = checkboxes.length; i < n; i++) {
    e.form["NameLists_" + i + "__IsDeleted"].checked = false;
}

e.form["NameLists_" + i + "__IsDeleted"].checked = false;

In javascript, you can access members using both the member.name syntax and member["name"]. They're functionally identical, the latter letting you access arbitrary names where you don't know what it is ahead of time.


Need Your Help

Spring,Quartz and JobStoreTX

spring quartz-scheduler

By using CronTriggerBean i have created two triggers(say trigger A &amp; B) for invoking two different action. We have placed our project as .war in 2 servers.I am using JobStoreTX for clustering. ...

Scanner on text file hasNext() is infinite

java java.util.scanner java-io

I'm writing a simple program in Java and it requires reading data from a text file. However, I'm having trouble counting lines. The issue seems generic enough for a simple Google search but I may not

Storing pair of ints on the list

c# list integer

How can I store pairs of integers in a List?