title: Making visible object hidden and hidden object visible
body: <p>I have a javascript function that is supposed to make visible objects hidden and hidden objects visible. since I lack of basic javascript knowlegde, I came here to ask help from you :/ Can someone help me out with my code so that I can learn a little?</p>
  
  <pre><code>function DisplayMenu(obj) {
              if (obj.style.visibility == 'visible') {
                  obj = document.getElementById(obj);
                  obj.style.visibility = 'hidden';
              }
              else if (obj.style.visibility == 'hidden') {
                  obj = document.getElementById(obj);
                  obj.style.visibility = 'visible';
              }
          }
  </code></pre>