When changing the href attribute of a link using jQuery, how do I reference the current href attribute?
<p>I'm trying to change the href attribute of links on my page. I need the bulk of the url to remain the same but just change a parameter. I've got this so far:</p>

<pre><code>$("a[href*='/new_note?']").attr('href', function() {
    return this.replace(/date1=[\d-]+/, "date1=" + $("[name='new_date1']").val());
});
</code></pre>

<p>but I'm getting this error:</p>

<pre><code>this.replace is not a function
</code></pre>

<p>What am I doing wrong? Thanks for reading.</p>
