[jQuery] traversing over items (like foreach in php)

[jQuery] traversing over items (like foreach in php)

Hey guys,
I have a list that contains images as anachors. I need to iterate over the items and apply the height of each image to the anachor that surround it (to fix a displaying problem in IE).
My code would look somehow like this:
$("#navi ul li a").attr("height", $("#navi ul li a img").attr("height"));
Of course this doesn't work, as the code needs to iterate over every list item seperately.
How would I achieve that?
Thanks for you help,
Samy