title: Click a button, reload window with parameters, and remove button
body: <p>So I've got a web page with a div that covers the entire page asking the customer to select their preferred currency.</p>
  
  <p>When they select either USA or UK the page reloads with the currency parameter in the URL (/?currency=GBP) and this changes the prices displayed on the page. </p>
  
  <p>However no matter what I try I can't get that div to display none when the page reloads.</p>
  
  <p>So here's the code for the pop-over:</p>
  
  <pre><code>&lt;div id="floatingBox"&gt;
      &lt;div&gt;
          The two buttons go here.
          &lt;a href="/?currency=GBP"&gt;UK&lt;/a&gt;
          &lt;a href="/?currency=USD"&gt;USA&lt;/a&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here's the style for the id floatingBox:</p>
  
  <pre><code>#floatingBox {
      z-index: 39879;
      display: block;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
  }
  </code></pre>
  
  <p>And here's the JavaScript I'm using:</p>
  
  <pre><code>if (window.location.search.search('GBP')) {
      document.getElementById('floatingBox').display = 'none';
  }
  
  if (window.location.search.search('USD')){
      document.getElementById('floatingBox').display = 'none';
  }
  </code></pre>
  
  <p>So basically everything is working fine, other than removing #floatingDiv when the user has selected an option.</p>
  
  <p>How do I make this div not appear when the page is reloaded and when there is a URL parameter? Using JavaScript not jQuery.</p>
  
  <p>I'm thinking that it might be better to use the onclick and run a function that uses localStorage and calling the style variable for that div or something like that...</p>
  
  <p>Any help appreciated :)</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I'm going to test:</p>
  
  <pre><code>var hide = localStorage.getItem('currChoice') || 0;
  if (hide == 1){
      document.getElementById('floatingBox').style.display = "none";
  }
  
  function gbpClick(){
      var currChoice = 1;
      localStorage.setItem('currChoice', currChoice);
      location.href='/?currency=GBP';
  }
  
  function usdClick(){
      var currChoice = 1;
      localStorage.setItem('currChoice', currChoice);
      location.href='/?currency=USD';
  }
  </code></pre>