title: delete elements with index greater then a clicked one
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).on('click', '.crumb', function () {
  var i = $(this).index('.crumb');
  $('#path *:gt(i)').remove();
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.crumb{
  display:inline-block;
  margin:0 7px;
  cursor:pointer;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class='path' id='path'&gt;
  &lt;div class='crumb'&gt;home&lt;/div&gt;
  &lt;div class='crumb'&gt;comp&lt;/div&gt;
  &lt;div class='crumb'&gt;display&lt;/div&gt;
  &lt;div class='crumb'&gt;reset&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I want to remove all elements from <code>path</code> with index greater then a clicked one.</p>
  
  <p>So click on <code>display</code> should remove <code>reset</code>. Click on <code>comp</code> should remove <code>display and reset</code>. And so on.</p>
  
  <p>But it doesn't work.</p>