title: Changing background colour with drop down menu
body: <p>I am doing some uni work and I am stuck on this bit of code. I have to change the background colour of the page using a drop down menu.</p>
  
  <p>Drop down menu code</p>
  
  <pre><code> &lt;form&gt;
      Background colour:
      &lt;select id= background&gt;
       &lt;option value="White"&gt; White &lt;/option&gt;
       &lt;option value="Green" &gt; Green&lt;/option&gt;
       &lt;option value="Black"&gt; Black &lt;/option&gt;
  
  
  
  &lt;/select&gt;
  </code></pre>
  
  <p>if statement </p>
  
  <pre><code>&lt;script&gt;
  function myFunction() {
  var sel1 = document.getElementId('background')
  
  if(sel1 =="Green"){
  
  document.body.style.backgroundColor = Green
  
  }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Also here is the button that runs the function</p>
  
  <pre><code> &lt;button onclick="myFunction()"&gt;Change Background&lt;/button&gt;
  </code></pre>