title: Javascript / jQuery get all url parameters and add/change one
body: <p>I have the following url</p>
  
  <pre><code>http://www.domain.com?page=options&amp;tab=general
  </code></pre>
  
  <p>I want to be able to get to the tab parameter and change it e.g</p>
  
  <p>I have two tabs General &amp; Styles and when I click on styles, I want a hidden field(that has this url as a value) to change so that it reads the same url but with the tabs parameter changed to styles. So it would look like this</p>
  
  <pre><code>http://www.domain.com?page=options&amp;tab=styles
  </code></pre>
  
  <p>However, this url may not have the parameter tab when the page is loaded so i need to be able to add a parameter to the url query string.</p>
  
  <p>There will be many more tabs so I cannot just replace the text general with styles</p>
  
  <p>Anyone know? 
  Thanks</p>