[jQuery] Add Href Values to create a querystring

[jQuery] Add Href Values to create a querystring


Hi to all, hope you can help..
I need to add and remove href values as you click in a list, ex:
<div id="brand">
<ul>
<li><a href="1">Yahoo</a></li>
<li><a href="2">Yahoo</a></li>
</ul>
</div>
And need to pass values to form a url.. if i click on 1 then the url
to get will be:
some.php?brand=1
If i click on # 2, then
some.php?brand=1,2
If i click on 1 again will remove the value because it was clicked
already
some.php?brand=2
Thanks