jquery - selecting ul elements by number of li children -


Hello all I want to create a function that is all of UL on screen which contains at least 3 elements Are there. I need this as a jquery object so I have no problem that it will be a function or just a selector.

How do I do this?

Thanks

  $ ("ul"). Filter (function () {return $ (= $) this). children (). Length & lt; 3;}). DoSomething ();  

With this we have all the & lt; Ul & gt; getting the element, then filtering it under only , who have fewer than 3 children.


Comments