title: Not able to toggle between different div section in html
body: <p>Trying to toggle between different div upon clicking the button.</p>
  
  <pre><code>&lt;button onclick="myFunction('myDIV')"&gt;Try it&lt;/button&gt;
  &lt;button onclick="myFunction('myDIV2')"&gt;Try it 2&lt;/button&gt;
  &lt;button onclick="myFunction('myDIV3')"&gt;Try it 3&lt;/button&gt;
  </code></pre>
  
  <p>These are Div i want execute</p>
  
  <pre><code>&lt;div id="myDIV" style="display:none;"&gt;
  This is my DIV element.
  &lt;/div&gt;
  
  &lt;div id="myDIV2" style="display:none;"&gt;
  This is second DIV element.
  &lt;/div&gt;
  
  &lt;div id="myDIV3" style="display:none;"&gt;
  This is 3rd DIV element.
  &lt;/div&gt;
  </code></pre>
  
  <p>Javascript code to  handle the button click and toggle between the div</p>
  
  <pre><code>function myFunction(id) {
  var divs = ["myDIV","myDIV2","myDIV3","myDIV4","myDIV5"];
  for(i = 0; i &lt;  5; i++){
  if(divs[i] == id)
      {document.getElementById(id).style.display = "block";}
  else
      {document.getElementById(id).style.display = "none";}
  document.getElementById("debug").innerHTML = divs[i];
  }
  </code></pre>
  
  <p>upon clicking it will always points to the div3, please help. Thankyou.</p>