How to remove variables from links on a page with jQuery
<p>Simply I have a bunch of links like so</p>

<pre><code>&lt;div id="categoryLinks"&gt;
    &lt;a href="blah.php?something=this&amp;category=21"&gt;&lt;/a&gt;
    &lt;a href="blah.php?something=that&amp;category=21"&gt;&lt;/a&gt;
    &lt;a href="blah.php?something=then&amp;category=21"&gt;&lt;/a&gt;
&lt;/div&gt;
</code></pre>

<p>What I'd like to be able to do however, is go through all those links and remove the end bit '&amp;category=21' should I choose to so they would all look like:</p>

<pre><code>&lt;div id="categoryLinks"&gt;
    &lt;a href="blah.php?something=this"&gt;&lt;/a&gt;
    &lt;a href="blah.php?something=that"&gt;&lt;/a&gt;
    &lt;a href="blah.php?something=then"&gt;&lt;/a&gt;
&lt;/div&gt;
</code></pre>

<p>So I'm working on the function that looks something like this:</p>

<pre><code>function removeCategory(){

    $('#categoryLinks a').each(function(){

        // as you can see, i don't know what goes in here!   

});


}
</code></pre>

<p>I know how to do the opposite, which is to append a category to the href, but as far as taking it off I am drawing a blank.</p>

<p>How do I do this?</p>
