title: How to get the nested ul li text in jquery onclick
body: <p>How to get the text in nested ul li text in <code>onclick</code> in jquery
  my code is as follows, </p>
  
  <p>When I click the li I need to get the current li text,</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>$('.selectRow li').on('click', function() {
    var textSelected = $(this).text();
    console.log(textSelected)
  })</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;ul class="selectRow"&gt;
    &lt;li&gt;test-1&lt;/li&gt;
    &lt;li&gt;test-2&lt;/li&gt;
    &lt;li&gt;test-3
      &lt;ul&gt;
        &lt;li&gt;test-3.1&lt;/li&gt;
        &lt;li&gt;test-3.2&lt;/li&gt;
        &lt;li&gt;test-3.3&lt;/li&gt;
        &lt;li&gt;test-3.4&lt;/li&gt;
      &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;test-4&lt;/li&gt;
      &lt;li&gt;test-5&lt;/li&gt;
      &lt;li&gt;test-6
        &lt;ul&gt;
          &lt;li&gt;test-6.1&lt;/li&gt;
          &lt;li&gt;test-6.2&lt;/li&gt;
          &lt;li&gt;test-6.3&lt;/li&gt;
          &lt;li&gt;test-6.4&lt;/li&gt;
        &lt;/ul&gt;
        &lt;/li&gt;
  &lt;/ul&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I getting the current li text onclick, but if li click the submenu li I am getting all parent li text and submenu li text also. Can anyone tell me the solution for this.</p>