Hi everyone,
Simply I have a bunch of links like so
<div id="categoryLinks">
<a href="blah.php?something=this&category=21"></a>
<a href="blah.php?something=that&category=21"></a>
<a href="blah.php?something=then&category=21"></a>
</div>
What I'd like to be able to do however, is go through all those links and remove the end bit '&category=21' should I choose to so they would all look like:
<div id="categoryLinks">
<a href="blah.php?something=this"></a>
<a href="blah.php?something=that"></a>
<a href="blah.php?something=then"></a>
</div>
So I'm working on the function that looks something like this:
function removeCategory(){
$('#categoryLinks a').each(function(){
// as you can see, i don't know what goes in here!
});
}
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.
How do I do this?