title: show/hide button not working
body: <p>I am creating a php page which shows mcq questions with options and answers from database. Here i am using a html button for show/hide answers. but its working only for the first question but while clicking on other questions it works for the first question only. kindly help</p>
  
  <pre><code>&lt;script&gt;
  function myFunction() {
  var x = document.getElementById('myDIV');
  if (x.style.display === 'none') {
      x.style.display = 'block';
  } else {
      x.style.display = 'none';
  }
  }
  &lt;/script&gt;
  
  
  &lt;?php
          while($row = mysqli_fetch_array($result))
          {
              echo "&lt;h4 style=font-weight:bold; text-align:justify&gt;";
              echo "Q $row[slno]) $row[question]";
              echo "&lt;/h4&gt;&lt;br&gt;";
              echo "&lt;ul class=list-group&gt;";
              echo "&lt;li class=list-group-item&gt;1) $row[option1]&lt;/li&gt;";
              echo "&lt;li class=list-group-item&gt;2) $row[option2]&lt;/li&gt;";
              echo "&lt;li class=list-group-item&gt;3) $row[option3]&lt;/li&gt;";
              echo "&lt;li class=list-group-item&gt;4) $row[option4]&lt;/li&gt;";
              echo "&lt;li class=list-group-item&gt;5) $row[option5]&lt;/li&gt;";
              echo "&lt;div id=myDIV style=display:none&gt;&lt;li class=list-group-item&gt;&lt;b&gt;Correct Option : ($row[correct_option])&lt;/b&gt;&lt;/div&gt;&lt;/li&gt;";
              echo "&lt;li class=list-group-item&gt;&lt;button onclick=myFunction()&gt;View Answer&lt;/button&gt;&lt;/li&gt;";
              echo "&lt;/ul&gt;";
              echo "&lt;hr color=#FF0000 size=5 width=100%&gt;";
          }
      ?&gt;
  </code></pre>
  
  <p>Any suggestions...</p>