title: Change div color with javascript
body: <pre><code> &lt;div id="change" style="height:20px; width:100%; position: absolute; float:bottom; background-color:#000000"&gt;
  &lt;/div&gt; &lt;br&gt;
                  &lt;select name="bgcolor" id="bgcolor" onchange="colorDiv()"&gt; 
                      &lt;option class="1" value=1&gt; Grey
                      &lt;option class="2" value=2&gt; White 
                      &lt;option class="3" value=3&gt; Blue
                      &lt;option class="4" value=4&gt; Cian
                      &lt;option class="5" value=5&gt; Green
                  &lt;/select&gt; &lt;br&gt;&lt;br&gt;
  
  &lt;p id="demo"&gt;&lt;/p&gt;       
  
  
  
  
  &lt;script&gt;
  function colorDiv(){
        var selection = document.getElementById('bgcolor');  
        var div = document.getElementById( 'change' );         
              div.style.backgroundColor='green';
  
        document.getElementById("demo").innerHTML =selection; 
  
        switch (selection){
            case 1:
              div.style.backgroundColor='grey';
            case 2:
              div.style.backgroundColor='white';  
            case 3:
              div.style.backgroundColor='blue';
            case 4:
              div.style.backgroundColor='cian';
            case 5:
              div.style.backgroundColor='green';    
         }
  &lt;/script&gt;      
  </code></pre>
  
  <p>Hi! I'm trying to change the background color of a div with js but it doesnt detect good the selected value, as i see when printing it on the parragraph. I've seen in multiple pages the procedure and it looks the same for me, but it actually does not work on my code. Can you see any mistakes?
  Thanks!!</p>