title: JavaScript "onClick" on li elements
body: <p>I made a menu bar with <code>ul</code> and <code>li</code> and I want some <code>onClick</code> events linked to JavaScript functions.</p>
  
  <p>But it does not work, clicking on menus don't do anything at all.</p>
  
  <p>The function is on a JS file I already use and I tested it on another element, it seems that id doesn't work only inside of my <code>li</code>.</p>
  
  <p>Here is the HTML:</p>
  
  <pre><code>&lt;div id="header"&gt;
      &lt;div id="titleContainer"&gt;
          blablabl
      &lt;/div&gt;
      &lt;ul id="menuContainer"&gt;
          &lt;li class="menuItem" id="videoMenu"&gt;
              &lt;a href="#" onClick="showAbout2();"&gt; Video&lt;/a&gt;
          &lt;/li&gt;
          &lt;li class="menuItem" id="playlistMenu"&gt;
              Playlist
          &lt;/li&gt;
          &lt;li class="menuItem" id="aboutMenu"&gt;
              About
          &lt;/li&gt;
          &lt;li class="menuItem" id="controlsMenu"&gt;
              Controls
          &lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The CSS:</p>
  
  <pre class="lang-css prettyprint-override"><code>#titleContainer
  {
      box-shadow: 0px 0px 5px #000;
      color: lightgrey;
      font-size: 20px;
      font-weight: bold;
      line-height: 50px;
      text-align: center;
  }
  
  #menuContainer
  {
      background-color: #333333;
      line-height: 35px;
      margin: 0;
      position: relative;
      text-align: center;
      z-index: -1;
  }
  
  #menuContainer li
  {
      display: inline;
      list-style: none;
  }
  </code></pre>
  
  <p>The JS:</p>
  
  <pre><code>function showAbout2()
  {
      console.log("bonjour");
  }
  </code></pre>
  
  <hr>
  
  <p><strong>ANSWER:</strong></p>
  
  <p>The answer was :</p>
  
  <p><strong>Removing the z-index.</strong></p>
  
  <hr>
  
  <p>I wanted to click on a lower-layered element.
  So i'll try this <a href="http://www.vinylfox.com/forwarding-mouse-events-through-layers/" rel="nofollow noreferrer">http://www.vinylfox.com/forwarding-mouse-events-through-layers/</a></p>
  
  <p>Thanks everyone : )</p>