title: Resetting a select box not working on iPad, but works on Chrome on Windows
body: <p>Here's the Javascript code I'm using right now.</p>
  
  <pre><code>$(document).ready(function(){
      $('#altNav').change(function(){
          var altNavSelectedVal = $('#altNav').val();
          if (altNavSelectedVal != 'currentPage')
          {
              $('#altNav option[value="currentPage"]').attr('selected', 'selected');
              location.href = altNavSelectedVal;
          }
      });
  });
  </code></pre>
  
  <p>It's used to reset a select box with the ID <code>altNav</code> to the option with the value <code>currentPage</code> before navigating to the next page.</p>
  
  <p>This is to prevent the browser from caching its previous value. For example, if I'm on the About page and I change it to Services, it will take me to the Services page. If I hit the browser back button it will go back to the About page but will have its active selection be Services, since it was changed to services just before it changed the page.</p>
  
  <p>The HTML code is below.</p>
  
  <pre><code>&lt;select id="altNav"&gt;
      &lt;option value="/"&gt;Home&lt;/option&gt;
      &lt;option value="/services"&gt;Services&lt;/option&gt;
      &lt;option value="currentPage" selected="selected"&gt;Contact&lt;/option&gt;
      &lt;option value="/about"&gt;About&lt;/option&gt;
      &lt;option value="/news"&gt;News&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>Normally the Contact option would have a value of <code>/contact</code> if it was on another page, but it's different for each page. The normal values are <code>/</code> for Home, <code>/services</code>, <code>/contact</code>, <code>/about</code>, and <code>/news</code>, but when it's on one of those page, that option's value is set to <code>currentPage</code>.</p>
  
  <p>Anyway, the code works as it's supposed to on Chrome for Windows, but when I test on iPad (and probably iPhone), when hitting the back button it always returns to Home.</p>
  
  <p>When I comment out the line <code>location.href = altNavSelectedVal;</code> it should, if I for example am on the News page and select Services, switch back to News after I select Services, but it actually selects Home. I don't understand why it would only do this on iOS.</p>