hi, im trying to wrap a fancybox link around each image on a site, which has an alt tag specified.
Right now i have this html markup: <p> <img src="1_s.jpg" alt="1_b.jpg" title="asdasd" /> </p> And this javascript-code: $(document).ready(function() { $("img[alt]").each(function(){ $(this).wrap($('<a href="'+$(this).attr('alt')+'" class="fancyBoxImage">')); }); $(".fancyBoxImage").fancybox(); }); And it's working perfect in every browser, except IE7 and 8 (haven't tested it in IE6 yet). Does anybody has a explanation for it?