Guest_imported
New member
- Jan 1, 1970
- 0
Here's the code:
for (N=1; N<=10; N++)
{
<span id=N></span>
}
This will create 10 span fields with id's of 1 to 10
How do I access each of these id's innerText without hardcoding them?
for (N=1; N<=10; N++)
{
N.innerText = N
}
This doesn't work, as it's trying to write to N.innerText and not 1.innerText to 10.innerText? I need to access N's variable & not N itself!
Thanks if you can help
Neil Kightley
for (N=1; N<=10; N++)
{
<span id=N></span>
}
This will create 10 span fields with id's of 1 to 10
How do I access each of these id's innerText without hardcoding them?
for (N=1; N<=10; N++)
{
N.innerText = N
}
This doesn't work, as it's trying to write to N.innerText and not 1.innerText to 10.innerText? I need to access N's variable & not N itself!
Thanks if you can help
Neil Kightley