title: Javascript Hide/shown Toggle Didn't Work
body: <p>I'm trying to Make a Javascript Toggle Such that when i click on any of below divNO buttons only that div shown all other Hide. But It didn't work:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function toggle(show,hide) {
      document.getElementById(id).style.display = 'block';
      
      document.getElementById(id).style.display= 'none';
    
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;a href='#' onclick="toggle('show','hide')"&gt;div1&lt;/a&gt;
  &lt;a href='#' onclick="toggle('show','hide')"&gt;div2&lt;/a&gt;
  &lt;a href='#' onclick="toggle('show','hide')"&gt;div3&lt;/a&gt;
  &lt;a href='#' onclick="toggle('show','hide')"&gt;div4&lt;/a&gt;
  &lt;a href='#' onclick="toggle('show','hide')"&gt;div5&lt;/a&gt;
  &lt;div class='div1' &gt;first div&lt;/div&gt;
  &lt;div id='id' class='div2' style='display:none'&gt;second div&lt;/div&gt;
  &lt;div id='id' class='div3' style='display:none'&gt;third div&lt;/div&gt;
  &lt;div class='id' style='display:none'&gt;fourth div&lt;/div&gt;
  &lt;div class='id' style='display:none'&gt;fifth div&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>