title: Wordpress - Change Location (url) on element change
body: <p>I am looking to change a wordpress url when changed.</p>
  
  <p>The trigger is not hard, that is just a .change use of jQuery api. However at the moment I get:</p>
  
  <pre><code>?cat=bristol-bristol
  </code></pre>
  
  <p>When I change the value I would like to strip the code below from the url. I have already got this as follows::</p>
  
  <pre><code>?cat=
  </code></pre>
  
  <p>Current Script</p>
  
  <pre><code>&lt;script&gt;
      var dropdown = $('#element span');
  
      function ChangeUrl() {
  
          if ( if element is not empty... ){
              location.href = &lt;?php echo get_option('home');?&gt;/?locations=+dropdown.options[dropdown.selectedIndex].value;
          }
      }
  
      dropdown.onchange = ChangeUrl;
  &lt;/script&gt;
  </code></pre>