title: jQuery .on("click") event with exception
body: <p>Hi I'm using a collapsible tree on a list i made. it uses jQuery to collapse the tree on click and there is an edit button next to it. </p>
  
  <blockquote>
    <p>What I want to do: I want to use a selector that removes the edit span from the  click function so that when I click on edit nothing happens but when I click on the  the tree collapses.</p>
  </blockquote>
  
  <p>I want it to be something like:<code>$('.hotelsholder').on("click", "ul&gt;li:not(span)", function (e)</code> but this won't work.</p>
  
  <p>Here is my code:</p>
  
  <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).ready(function(){
    $('.hotelsholder').on("click", "ul&gt;li", function (e) {
      e.stopPropagation();
      $(this).toggleClass('changed');
      console.log(this);
      if ($(this).find("ul").first().css("display") === "none") {
        console.log('this' + $(this).find("ul").first().css("display"))
        $(this).children(":nth-child(2)").slideDown();
      } else {
        $(this).find("ul").slideUp();
      }
    });
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.hotelsholder&gt;ul&gt;li {
    cursor: pointer;
  }
  
  .editHotel {
    color: blue;
    margin-left: 20px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="hotelsholder"&gt;  
    &lt;ul&gt;
      &lt;li class=""&gt;
        first level
        &lt;span class="editHotel"&gt;edit&lt;/span&gt;
        &lt;ul style="display: block;"&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks in advance for the help.</p>