Okay I dont think anyone has covered this yet.
I have a div with x amount of images inside it. I need to add the class 00x to each image where the x starts at 1 and goes up everytime for each image. I have tried doing this with a for in statement however cant seem to make it work. I am using the jquery library so feel free to suggest jQuery related fixs. Here is my html:
<div id="fixed">
<img src="/prodimages/Ad060-2.jpg" />
<img src="/prodimages/Ad060-2.jpg" />
<img src="/prodimages/Ad060-2.jpg" />
</div>
so I need it to select all images inside #fixed and then add the class 00 + i where i++ for each image. I need something like a php foreach. I dont really understand how for in works.
Please advise. 🙂
In case the number of images should exceed 10, use something like: