I cant get this to work, I want to create a new element DIV with id = item and class = item+variable, like this:
<div id="item" class="item1"></div>
and then inject an image inside by selecting the newly created divs class resulting with something like this:
<div id="item" class="item1">
<img src="images/1.png" style="width: 64px; height: 64px;">
</div>
I think my problem is with my last inject selector, but im not sure, the div creates itself but doesnt inject the image.
var content = this.options.content;
var id = this.options.id;
new Element('div', {id: 'item', class: 'item'+id}).inject($('slot'+id));
new Element('img',{ src:'images/'+content+'.png', style:'width: 64px; height: 64px;' }).inject($('.item'+id));
you can use