title: Javascript show element on click
body: <p>I'm trying to do this without Jquery. I want to show a div when clicking a trigger. So far I have this to hide the element. </p>
  
  <pre><code> document.getElementById('element').style.display = 'none';
  </code></pre>
  
  <p>HTML..</p>
  
  <pre><code>&lt;div class="element"&gt;Ahem, boo!!&lt;/div&gt;
  &lt;a href="#" id="showDiv"&gt;Show&lt;/a&gt;
  </code></pre>
  
  <p>How do I create a function to show the div when clicking the link? I would like to avoid using functions like <code>onclick="showDiv()</code> in the link itself.</p>