title: Toggle Visibility in JavaScript
body: <p>I'm trying to make a button that shows a paragraph on click and hides it on a second click. Instead of using a more traditional method, I went with using JavaScript to change the style from <code>visibility:hidden</code> to <code>visibilitiy:visible</code>.</p>
  
  <pre><code>&lt;style&gt;
  #p {
  visibility:hidden;
  }
  &lt;/style&gt;
  
  &lt;button onclick="show() "&gt;Click me&lt;/button&gt;
  
  &lt;p id="p"&gt;hi&lt;/p&gt;
  
  &lt;script&gt;
  function show() {
      document.getElementById("p").style.visibility = "visible";
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>How can I do this without jQuery?</p>