View Full Version : Need help with a For/In statement

01-30-2009, 03:49 AM
Hey guys, here's my code in question:

for (x in magicName) {
document.getElementById('statuspane').innerHTML = "<div id='magic"+[x]+"'></div>";
document.getElementById('magic')[x].innerHTML = "<p>"+

What I'm trying to do here is create a magic[x] div inside "statuspane" for each x there is in magicName. This part works fine.

However, after it makes those divs, I want to access each one and put more content into them. I'm having a little trouble figuring out how to do that, though.

Can anyone help me out? Is what I'm trying to do even possible? (Fairly confident it is, though, and I'm just doing something silly)

// EDIT //
Nevermind I solved it!