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

c++ constructor malfunctioning

c++ qt constructor

I am trying to program a qt widget application which deals with linked list of nodes, the node contains 3 char* data member and 2 int members and a "next" pointer of "node" type,

Accessing .eh_frame data during execution

kernel linux-kernel c glibc elf

I'm trying to access the contents of .eh_frame section of a running program from within it (specifically, the program is Linux kernel 2.6.34.8). The .eh_frame contains useful data used for exception

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.