How can I tell jQuery to use the newly generated href attribute (generated with '.attr')?
<p>I'm modifying the content of a href attribute with jQuery:</p>

<pre><code>$("a#scrolll").attr("href", "#" + $("li.matched").attr("id"));
</code></pre>

<p><code>&lt;a href="#"&gt;scroll&lt;/a&gt;</code></p>

<p>and the output looks like this:</p>

<p><code>&lt;a href="#menu-id-123"&gt;scroll&lt;/a&gt;</code></p>

<p>If I click the link I'm taken to the element with that ID.</p>

<p>Below that jQuery line, I have the following:</p>

<pre><code>$("a#scrolll2").click(function() {
        $("a#scrolll").trigger("click");
});
</code></pre>

<p>With gives me something like this:</p>

<p><code>mydomain/somestuff#</code></p>

<p>So I think even if the <code>a#scrolll</code> link has now an ID in its href attribute, the jQuery code is is till thinking the attribute is the initial one ('#').</p>

<p>How can I tell jQuery to use the newly generated href attribute?</p>
