title: How does the following line of JavaScript work?
body: <p>I came across the following code:</p>
  
  <p>Javascript:</p>
  
  <pre><code>var ElementClicked = document.getElementById(IdClicked);
  ElementClicked.className = ElementClicked.className == 'hidden' ? '' : 'hidden';
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>div.hidden{
  height: 500px;
  }
  
  div{
  height: 0px;
  -webkit-transition: height 0.5s;
  transition: height 0.5s;
  overflow: hidden;
  }
  </code></pre>
  
  <p>The HTML contains two divs: </p>
  
  <pre><code>&lt;div id="homepage" class='hidden'&gt;
  .
  .
  .
  &lt;div id="intro_page" &gt;
  </code></pre>
  
  <p>The author calls the JavaScript function with the first div.</p>
  
  <p>I am unable to understand clearly what the JavaScript function is doing. I know what a conditional operator is and how it works.</p>
  
  <p>Can someone explain briefly what the function basically does?</p>