Hi,

I have the following DOM structure (unordered list), that I would like
to sort on the a href tag name using jQuery – specifically the
TinySort plug-in http://plugins.jquery.com/project/TinySort

Structure is as follows:

<div id="refmenu">
<ul id="list">
<li><a title="Google" href="....">Google</a></li>
<li><a title="Apple" href="....">Apple</a></li>
<li><a title="IBM" href="....">IBM</a></li>
<li><a title="Yahoo!" href="....">Yahoo!</a></li>
<li><a title="Hotmail" href="....">Hotmail</a></li>
</ul>
</div>

I have tried the following but to no avail, i.e.:
$("div#refmenu>ul#list>li").tsort("a[title]",{orderby:"title"});

Based on this, I am obviously trying to sort on the title attribute.

Any help would be great.

Other questions, do I need to make this call within the document.ready
() or can I just perform this call within a normal javascript
function?

Thanks.

Reply via email to