I have a dynamic pages where elements are always being removed and added. I am aligning the images left right left right.
Rather than having to change this every time someone is added or dropped. How can I add the align attribute to the image tags using jQuery?
$(".teamcontainer p img").attr("align","left");
Try this:
It loops over all
imgelements in the selector, if it is an even numbered item in the loop, it assignsalign = left, otherwisealign = right.