title: How to find the width of the child ul li a
body: <p>I have following unordered list wrapped in a div as below</p>
  
  <pre><code>    &lt;div id="menuwrapper"&gt;
      &lt;ul&gt;
       &lt;li&gt;home
             &lt;ul&gt;
               &lt;li&gt;&lt;a&gt;anchor1&lt;/a&gt;&lt;/li&gt;
               &lt;li&gt;&lt;a&gt;anchor2&lt;/a&gt;&lt;/li&gt;
               &lt;li&gt;&lt;a&gt;anchor3&lt;/a&gt;&lt;/li&gt;
            &lt;/ul&gt;
      &lt;/li&gt;
  
      &lt;li&gt;school&lt;/li&gt;
      &lt;li&gt;college&lt;/li&gt;
      &lt;/ul&gt;  
      &lt;/div&gt;
  </code></pre>
  
  <p>I need to find width of each anchors that is anchor1,anchor2,anchor3 tags width on hover of home.
  I have the following code which seems not to work</p>
  
  <pre><code>    $(function () {
  
        $("#menuwrapper ul li").hover(function () {
        var maxWidth = 0;
        $(this).find("ul li a").each(function () {
  
            if (this.width &gt; maxWidth)
                maxWidth = this.width;
        });
  
        $("#menuwrapper ul li ul li a").css("width", maxWidth);
    });
   });
  </code></pre>
  
  <p>Thanks for the help in advance </p>