Trying to place javascript statements in an array
<p>I have the line <code>document.getElementById('slot2').src ="snail.gif";</code> in my code and it works to change the img element to the appropriate gif.</p>

<p>However I also have an array called slots of three elements each of which is <code>document.getElementById('slotN')</code> or 1 2 and 3 in place of N.</p>

<p>When I use <code>slots[2].src ="snail.gif";</code> in a function it fails to do anything.</p>

<p>I know it has to do with converting the string of the statement into a statement but trying to use eval() doesn't seem to work either.</p>

<p>Any advice would be appreciated</p>
