alphabetize/sort an unordered list
Hi,
I'm fairly new to JQuery but can generally feel my way around. Would it be possible to alphabetize an unordered list when a page loads? i know this is kind of 'contrary' to the definition of unordered but it would seem like something JQuery could do.
For example, if I had the following list coded into a page,
-
<ul id="fruits">
<li>banana</li>
<li>pear</li>
<li>apple</li>
<li>grape</li>
</ul>
could JQuery reorder/alphabetize the list so that it renders as:
-
<ul>
<li>apple</li>
<li>banana</li>
<li>grape</li>
<li>pear</li>
</ul>
Thanks very much for any help or push in the right direction!