title: preventDefault(); jquery child affected
body: <p>I checked answer about that but couldn't adapt a solution so need your help. I'd like the <code>preventdefault();</code> works only to parents element but here it works for everything</p>
  
  <pre><code>&lt;ul class="links"&gt;
          &lt;li&gt;&lt;a href="#"&gt;&lt;b&gt;Accueil&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;
              &lt;a href="#"&gt;&lt;b&gt;Liste serveurs&lt;/b&gt;&lt;/a&gt;
                  &lt;ul class="sub"&gt;
                      &lt;li&gt;&lt;a href="#"&gt;&lt;b&gt;sub 1&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="#"&gt;&lt;b&gt;sub 2&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
          &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>JS</p>
  
  <pre><code>$('.links &gt; li').on('click',function(noway) {
          noway.preventDefault();
  
  });
  </code></pre>
  
  <p>Goal is when I click on <em>Liste serveurs</em>, <strong>.sub appear</strong>, but here when I click on <em>sub 1</em>, nothing happened. I'd like to go to the sub 1 link.</p>
  
  <p>EDIT: I don't get it, I feel it is totally wrong, but it works.</p>
  
  <pre><code>$('.links &gt; li').on('click',function(noway) {
              if($(this).attr("class") === "sub") { noway.preventDefault(); }
  
      });
  </code></pre>