title: Adding an onclick event to a div element
body: <p>I saw a few similar topics which did help but I have specific problem and didn't manage to solve it alone so if anyone can help out I would appreciate it</p>
  
  <p>I want to add onclick event to a div element. </p>
  
  <p>HTML: </p>
  
  <pre><code>&lt;div id="thumb0" class="thumbs" onclick="klikaj('rad1')"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>JavaScript:</p>
  
  <pre><code>function klikaj(i)
  {
      document.getElementById(i).style.visibility='visible';
  }
  </code></pre>
  
  <p>Wanted result: div with <code>id="rad1"</code> (which is hidden) turns visible, when clicked on div with <code>id="thumb0"</code>. </p>
  
  <p>This works when I add it to a button element but don't know how it goes with div elements.</p>