[jQuery] .replace(href)

[jQuery] .replace(href)

Hi,
I'm trying to covert some links from pico search on a site into local links. 
I tried
$(".prevnextbutton").each(function () {
    $(this).attr("href").replace("<a href="http://www.picosearch.com/cgi-bin/ts.pl?">
http://www.picosearch.com/cgi-bin/ts.pl?</a>","/local/path")
});
I get this error: <span class="objectBox objectBox-errorMessage hasBreakSwitch">$(this).attr("href") has no properties</span>
and then I tried:
$(".prevnextbutton").each(function () {
   link = $(this).attr("href");
   link = link.replace("<a href="http://www.picosearch.com/cgi-bin/ts.pl?">http://www.picosearch.com/cgi-bin/ts.pl?
</a>","/local/path");
console.log(link);
and I keep getting the error "<span class="objectBox objectBox-errorMessage hasBreakSwitch">link has no properties"
I feel like this is fairly obvious but I can't for the life of me get it!
Thanks for any help,
Will
</span>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/