var paginaSpam = "http://microsoft.com" $("a").attr("href",function(){this.realLink = this.href; return paginaSpam}).attr("target","_blank").click(unbind); function unbind(){ setTimeout(function(){$("a").attr("href",function(){this.href = this.realLink}).removeAttr("target").unbind("click",unbind); },20) if(this.realLink){window.location = this.realLink} }