Hi vitto, are you sure that the problem isn't somewhere else? Link would be fine...
Anyway, I have a tip for you. What about to make this a oneliner: $('a.ppt, a.pdf, a.allegato, a.doc, a.jpg, a.xls, a.external, a.zip').attr('target','_blank'); -- Bohdan Ganicky On Jan 31, 3:46 pm, hcvitto <[EMAIL PROTECTED]> wrote: > hi i'm using this code to add the target=_blank attribute to links. > > $("a[href]").each(function(){ > if ($(this).hasClass("ppt") || $(this).hasClass("pdf") || $ > (this).hasClass("allegato") || $(this).hasClass("doc") || $ > (this).hasClass("jpg") || $(this).hasClass("xls") || $ > (this).hasClass("external") || $(this).hasClass("zip")){ > $(this).attr("target","_blank"); > } > }); > > it works fine in firefox but not with ie which throws a javascript > error i can't identify. > > any idea why? is that my error or an ie bug? > > Thanks vitto