How to add index to constructed object?
<p>On (document).ready im would like to dynamically generate elements inside a certain parent-element. Lets call them "Candles".</p>

<p>Each "Candle" needs different properties for backgroundImage and color depending on their index().</p>

<p>After creating the page, these attributes need to be changeable via the interface. So its important to save the properties of the "candles" independent from each other.</p>

<p>Thats why I thought it might be useful, to generate for an object for each "Candle" to save their individual properties and to make them editable.</p>

<pre><code>    var candleAmount = 3;
for (var i=1; i &lt;= candleAmount; i++) {
    $("#container #candles").append("&lt;li&gt;&lt;img src=''&gt;&lt;/img&gt;&lt;/li&gt;");
    var Candle+i = [ "background":"+i+", "color":" - random - (ignore)" ]
    };
</code></pre>

<p>(please dont mind any failures in the code besides the "Candle+i", I'll figure it out.)</p>

<p><strong>EDIT:</strong> Ok, thank you so far. I might not made myself clear enaugh. 
Here is an way more reduced example:</p>

<pre><code>$("ul#candles li").each( function(i) {
  candle+i = i+" Anything";
  });

alert(candle4);
</code></pre>

<p>I would love to create an amount of variables depending on the Amount of child-objects.
What would be the correct syntax, or isn't there any?</p>

<p>Thank you</p>
