title: How to get index of clicked element?
body: <p>I have five anchor elements in my navigation. I want to get index of clicked element with jQuery. I tried this code.</p>
  
  <pre><code>$('.navigation ul li a').click(function(e) {
  
    e.preventDefault();
  
    var el = $(this).index();
    console.log(el);
  
   })
  </code></pre>
  
  <p>But every time I get zero in console.</p>
  
  <p><a href="https://jsfiddle.net/2hg2fkda/" rel="nofollow">https://jsfiddle.net/2hg2fkda/</a> fiddle is here.</p>
  
  <p>Any help will be appreciated. Thanks,</p>