Unable to find blank lists with Jquery
<p>In my Dom I got some <code>li</code>'s which includes some as.net text boxes as their children.I need to set some of the text-boxes as visible false.When i do this ,the <code>li</code> wrapped around this textbox is shown as empty in html.So I desided to remove them and i used this code (and lot more)</p>

<pre><code>    &lt;script type="text/javascript"&gt;
    $(document).ready(function (e) {
        $('#u li').each(function () {
            if ($(this).html().length == 0) {
                $(this).remove();
            }
        });
    });
&lt;/script&gt;
</code></pre>

<p>To my surprise No <code>li</code> get in to the loop for empty ones.
Note added HTML</p>

<pre><code>    &lt;ul id="u"&gt;
                   &lt;li class="first-item odd-item"&gt;
                       &lt;span id="ContentPlaceHolderDefault_cphContents_ShopConfirmation_2_lblFirstname"&gt;Firstname&lt;/span&gt;
                        &lt;input type="text" id="ContentPlaceHolderDefault_cphContents_ShopConfirmation_2_txtFirstname" name="ctl00$ctl00$ctl00$ContentPlaceHolderDefault$cphContents$ShopConfirmation_2$txtFirstname"&gt;
                        &lt;span style="color:Red;visibility:hidden;" id="ContentPlaceHolderDefault_cphContents_ShopConfirmation_2_reqirefieldFirstname"&gt;*&lt;/span&gt;
                   &lt;/li&gt;
                   &lt;li class="odd-item"&gt;
                       &lt;span class="m-left" id="ContentPlaceHolderDefault_cphContents_ShopConfirmation_2_lblLastname"&gt;Lastname&lt;/span&gt;
                        &lt;input type="text" id="ContentPlaceHolderDefault_cphContents_ShopConfirmation_2_txtLastname" name="ctl00$ctl00$ctl00$ContentPlaceHolderDefault$cphContents$ShopConfirmation_2$txtLastname"&gt;
                       &lt;span style="color:Red;visibility:hidden;" id="ContentPlaceHolderDefault_cphContents_ShopConfirmation_2_reqirefieldLastname"&gt;*&lt;/span&gt;
                   &lt;/li&gt;
                   &lt;li class="third-item odd-item"&gt;
                       &lt;span id="ContentPlaceHolderDefault_cphContents_ShopConfirmation_2_lblEmployeenumber"&gt;Emloyee Number&lt;/span&gt; 
                        &lt;input type="text" id="ContentPlaceHolderDefault_cphContents_ShopConfirmation_2_txtEmployeenumber" name="ctl00$ctl00$ctl00$ContentPlaceHolderDefault$cphContents$ShopConfirmation_2$txtEmployeenumber"&gt;
                    &lt;/li&gt;
                    &lt;li class="odd-item"&gt;


                    &lt;/li&gt;
                    &lt;li class="odd-item"&gt;
                        &lt;span id="ContentPlaceHolderDefault_cphContents_ShopConfirmation_2_lblAddress"&gt;Address&lt;/span&gt;
                        &lt;select id="ContentPlaceHolderDefault_cphContents_ShopConfirmation_2_dropdownaddress" name="ctl00$ctl00$ctl00$ContentPlaceHolderDefault$cphContents$ShopConfirmation_2$dropdownaddress"&gt;
    &lt;option value="-----------Select-----------"&gt;-----------Select-----------&lt;/option&gt;
    &lt;option value="dfddfd"&gt;dfddfd&lt;/option&gt;
    &lt;option value="gdfgfg"&gt;gdfgfg&lt;/option&gt;
    &lt;option value="fhgfgfgf"&gt;fhgfgfgf&lt;/option&gt;

&lt;/select&gt;
                    &lt;/li&gt;
                    &lt;li class="third-item last-item odd-item"&gt;


                    &lt;/li&gt;

                  &lt;/ul&gt;
</code></pre>
