title: On click show div, image
body: <p>I've made this code to show me a div when I click on a box:</p>
  
  <p>JS</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var bool = 0;
  function showDiv() {
      if (bool == 1) {
          bool = 0;
          document.getElementById('show').style.visibility = "hidden";
      } else if (bool == 0) {
          bool = 1;
          document.getElementById('show').style.visibility = "visible";
      }
  }​
  &lt;/script&gt;
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;input type="button" value="click" onclick="showDiv();" /&gt;
  
  &lt;div id="show" style=" visibility:hidden;"&gt;
    &lt;p&gt;it is okay it is okay it is okay it is okay it is okay&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>But, how do I do this when it's an image I want to click on to show the div.</p>