Hi, I quickly made this function for a script im using:
$.fn.liCount = function(){
var i=0;
$(this).children().each(function(){
i++;
});
return Number(i);
}
problem is IE returns 0, anyone know why?
alert( $("ul").liCount() );
edit:
<div id="prev-quotes">
<ul id="quote-list">
<li id="quote_content_wrapper" >
<ul>
<li class="quote_li">
<span class="service_quote"><a href="#">Web Design Services</a></span>
<br>
<span class="cost_quote"><strong>£192</strong> - <a id="7" href="#">delete</a> | <a id="7" href="#">view</a></span>
</li>
<li class="quote_li">
<span class="service_quote"><a href="#">Web Design Services</a></span>
<br>
<span class="cost_quote"><strong>£192</strong> - <a id="7" href="#">delete</a> | <a id="7" href="#">view</a></span>
</li>
<li class="quote_li">
<span class="service_quote"><a href="#">Web Design Services</a></span>
<br>
<span class="cost_quote"><strong>£192</strong> - <a id="7" href="#">delete</a> | <a id="7" href="#">view</a></span>
</li>
</ul>
</li>
<li>
<a id="first-quote" href="#">Previous Quotes</a>
<img height="16" width="16" id="warning" src="images/for_web/check_mark.png">
</li>
</ul>
</div>