title: How to get only the first list element in menu of unordered list in JQuery?
body: <p>I need to get the first element in the list of unordered lists. I used bellow code and getting all list items as output. Then I click f12 and executed this code [image description output of this code][1]
    [1]: <a href="https://i.stack.imgur.com/OZ4qn.png" rel="nofollow noreferrer">https://i.stack.imgur.com/OZ4qn.png</a><code>jQuery(window).resize(function() {</code> </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;title&gt;Example&lt;/title&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
    &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"&gt;
  
    &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"&gt;&lt;/script&gt;
    &lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"&gt;
    &lt;link rel="stylesheet" href="style.css"&gt;
  &lt;script&gt;
  jQuery(document).ready(function(){
  setTimeout(function(){
  jQuery(window).resize(function() {
  jQuery(".mean-nav&gt;ul&gt;li:first").click(function(){
    alert(jQuery(this).text());
     });
      });
       },2000);
  });
  
  &lt;/script&gt;
  
    &lt;/head&gt;
  &lt;body&gt;
  &lt;div&gt;
   &lt;!--&lt;div class="leader1"&gt;REgister&lt;/div&gt;
   &lt;div class="leader2"&gt;Login&lt;/div&gt;
    &lt;div class="leader3"&gt;Call Us&lt;/div&gt;--&gt;
     &lt;div class="mean-nav"&gt;
      &lt;ul&gt;
       &lt;li&gt;1
       &lt;ul&gt;
  
          &lt;li&gt; aa&lt;/li&gt;
          &lt;li&gt; bb&lt;/li&gt;
          &lt;li&gt; cc&lt;/li&gt;
          &lt;li&gt; dd&lt;/li&gt;
          &lt;li&gt; ee&lt;/li&gt;
      &lt;/ul&gt;
      &lt;/li&gt;
        &lt;li&gt;2&lt;/li&gt;
        &lt;li&gt;3&lt;/li&gt;
         &lt;li&gt;4&lt;/li&gt;
         &lt;li&gt;5&lt;/li&gt;
         &lt;/div&gt;
       &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>