html - How do i search through and sort a collection of li's using jquery? -


I have received something that I want to sort through and sort through jquery use.

Things have been found to solve and find through Lee.

Is there a good plugin that can handle both things (search + sort) or is there a way to combine two solutions into the above links?

Edit: In short, I'm searching for something like this, but rather than a table, it should work on UL

Thanks!

Well, I always like doing this because of a lot of deviation in my code.

A good start is to catch all of your LI items within an array (which already owns some simple sorting methods).

Search & amp; Sorting within the array should not be a problem.

  var li_elements = []; (Var i = 0; i & lt; 10; i ++) {var exampleli = $ (' & gt;', text: 'I am an example', id: 'id' + i }); Li_elements.push (exampleli); }  

You can now sort / search / delete and finally add those elements to an ul element.


Comments