Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #19461
| From | "Tony" <tony.johansson@inport.com> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | How do I use getElementById in my situation |
| Date | 2013-04-25 11:00 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <klar57$cfi$1@dont-email.me> (permalink) |
I have a for loop from 0 to 8 and I want to fetch the DOM element id that is
called elem0, elem1, elem2, elem3, elem4 , elem5, elem6, elem7, elem8 like
this
for (var i = 0; i < antalColumner; i++) //0 - 7
{
var item = "elem" + i;
elem = document.getElementById(item);
}
I must make the getElementById to understand that I want "elem0" and "elem1"
and so on
//Tony
Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread
How do I use getElementById in my situation "Tony" <tony.johansson@inport.com> - 2013-04-25 11:00 +0200
Re: How do I use getElementById in my situation "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2013-04-25 12:19 +0300
Re: How do I use getElementById in my situation "Tony" <tony.johansson@inport.com> - 2013-04-25 11:29 +0200
Re: How do I use getElementById in my situation "Tony" <tony.johansson@inport.com> - 2013-04-25 11:32 +0200
Re: How do I use getElementById in my situation "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2013-04-25 12:35 +0300
csiph-web