title: Display Block and Display None with Option Value
body: <p>I'm trying to create a toggle that will <code>display:block</code> and <code>display:none</code> for different blocks of code similar to the code box at <a href="https://www.lob.com/" rel="nofollow">lob.com</a> beside "
  An intuitive RESTful API". </p>
  
  <p>I have been trying to get this to work based of this <a href="http://jsfiddle.net/CaVBZ/1/" rel="nofollow">jsfiddle</a> but I can't get it to work but I'm not sure if this code is what I need to achieve what's done at lob.com </p>
  
  <pre><code>&lt;select id="getFname" onchange="admSelectCheck(this);"&gt;
      &lt;option value="1"&gt;Jay&lt;/option&gt;
      &lt;option value="4"&gt;Sam&lt;/option&gt;
      &lt;option id="admOption" value="0"&gt;Admin&lt;/option&gt;
  &lt;/select&gt;
  &lt;div id="admDivCheck" style="display:none;"&gt;
      admin selected
  </code></pre>
  
  <p>JavaScript:</p>
  
  <pre><code>function admSelectCheck(nameSelect)
  {
      if(nameSelect){
          admOptionValue = document.getElementById("admOption").value;
          if(admOptionValue == nameSelect.value){
              document.getElementById("admDivCheck").style.display = "block";
          }
          else{
              document.getElementById("admDivCheck").style.display = "none";
          }
      }
      else{
          document.getElementById("admDivCheck").style.display = "none";
      }
  }
  </code></pre>
  
  <p>Ultimately it will need to be able to toggle between the two drop downs like on lob.com  so there would be 8 sets of divs if there were 4 options on the left and then 2 on the right.</p>
  
  <p>Could anyone point me in the right direction to learn how to do this as I'm not sure if I should be using JQuery or not. Basically I'd like to know exactly how lob.com did it so I can go down the right road!</p>
  
  <p>Thanks if anyone can point me.</p>