Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Var with javascript! 1

Status
Not open for further replies.

fireburner69

Programmer
Aug 22, 2002
108
GR
Is there any way of creating var while looping from 1 to 100?

For example I want to create 100 vars that has this name

Example1 = 10;
Example2 = 10;
...
Example100 = 10;

Is there a way of doing this?

something like that?

var 'Example'+i = 10;
 
Code:
for(i=1;i<101;i++){
  window["Example"+i]=10;
}

Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top