title: trying a simple show/hide slider for displaying seperate divs, unable to map it to slider.value to an array
body: <p>I have been learning javascript myself from w3school and an opportunity to try some skills I learned arose when I was tackled with a problem of showing different venues at my work according to selected capacity so I decided to make a slider and thought I could map slider.value to an array variable but I have tried that and it doesn't work.</p>
  
  <p>please guide how to approach this, I am really a Lvl 1 so I am sure I am making a really stupid mistake somewhere,
  Thanks a lot for you time.</p>
  
  <p>here is the code </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-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
  &lt;style&gt;
  .slidecontainer {
    width: 100%;
  }
  
  .slider {
    -webkit-appearance: none;
    width: 100%;
    height: 15px;
    border-radius: 5px;
    background: #d3d3d3;
    outline: none;
    opacity: 0.7;
    -webkit-transition: .2s;
    transition: opacity .2s;
  }
  
  .slider:hover {
    opacity: 1;
  }
  
  .slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #1A77B9;
    cursor: pointer;
  }
  
  .slider::-moz-range-thumb {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
  }
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;h1&gt;Round Range Slider&lt;/h1&gt;
  
  &lt;div class="slidecontainer"&gt;
    &lt;input type="range" min="10" max="500" value="20"step ='10' class="slider" id="myRange" onchange ="myfunction()"&gt;
    &lt;p&gt;Value: &lt;span id="demo"&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/div&gt;
  
  &lt;div id="myDIV"&gt;
  This is my DIV element.
  &lt;/div&gt;
  
  
  &lt;script&gt;
  
  var slider = document.getElementById("myRange");
  var output = document.getElementById("demo");
  output.innerHTML = slider.value;
  
  slider.oninput = function() {
    output.innerHTML = this.value;
  }
  var smallCap = [10, 20, 30 , 40, 50];
  var Capacity;
  
  function myfunction() {
    var x = document.getElementById("myDIV");
    if (slider.value === "50" ) {
      x.style.display = "block";
    } else {
      x.style.display = "none";
    }
  }
  
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>