title: I am trying to add a class to a certain div and it is only adding it to one of the div's with this ID, why?
body: <p>I am trying to add a class to a div based on when this wheel stops on a tile. I am newer to javascript and I am trying to learn. It works when the wheel stops on the first label in the data variable but not the others, why? Here is the javascript that adds the class to the div</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>var name = document.getElementById("slide-area");
   var divname = document.getElementById("question-slide");
   var number = divname.getAttribute("data-number");
   var pickvalue = data[picked].value;
   if(pickvalue == number){ 
   divname.className += " display";    
    }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here is a link to my code <a href="https://code.sololearn.com/WM3ISd3OEEUc" rel="nofollow noreferrer">https://code.sololearn.com/WM3ISd3OEEUc</a> </p>