title: Using switch statement to show pictures in javascript
body: <p>I want to make the image1 visible when it is Sunday, image2 visible when it is Monday, and so on, using the switch statement in Javascript. How do i do this?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  
  &lt;p&gt;Click the button to display what day it is today.&lt;/p&gt;
  
  &lt;button onclick="myFunction()"&gt;Try it&lt;/button&gt;
  
  &lt;p id="demo"&gt;&lt;/p&gt;
  
  &lt;script&gt;
  function myFunction()
  {
      var x;
      var d=new Date().getDay();
      switch (d)
      {
          case 0:
              x="Today it's Sunday";
              break;
          case 1:
              x="Today it's Monday";
              break;
          case 2:
              x="Today it's Tuesday";
              break;
          case 3:
              x="Today it's Wednesday";
              break;
          case 4:
              x="Today it's Thursday";
              break;
      }
      document.getElementById("demo").innerHTML=x;
  }
  &lt;/script&gt;
  
  &lt;img src="image1.png" id="one"style="visibility:Hidden"/&gt;
  &lt;img src="image2.png" id="one"style="visibility:Hidden"/&gt;
  &lt;img src="image3.png" id="one"style="visibility:Hidden"/&gt;
  &lt;img src="image4.png" id="one"style="visibility:Hidden"/&gt;
  &lt;img src="image5.png" id="one"style="visibility:Hidden"/&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>