I just asked a question about ordering but it was only the first part of what I needed. I want to ask the full question now to see if its possible:
Its for a chat webpage and users can be online (active), offline (noactive) or have a message pending (msg) or no message pending (nomsg). Also keep the ID name in mind for A-Z
eg:
<div id="chatCenterMembers">
<div id="lee" class="chatmember 10001 active msg"></div>
<div id="arch" class="chatmember 10008 noactive nomsg"></div>
<div id="steven" class="chatmember 10041 noactive msg"></div>
<div id="tim" class="chatmember 10432 active nomsg"></div>
<div id="ssan" class="chatmember 10007 active msg"></div>
<div id="yanti" class="chatmember 10034 noactive msg"></div>
</div>
Is it possible to order this as follows:
1. active msg (A-Z)
2. active nomsg (A-Z)
3. noactive msg (A-Z)
4. noactive nomsg (A-Z)
thx
The most basic way to do this would be to create 4 arrays (one for each case of active/msg), and separate the divs into those arrays. Then, sort each array. Lastly, either write the divs to the page in order of the arrays, or combine them into one array and write that one to the page. This allows you, if you later decide to, to change the ordering of active vs inactive/msg vs no message by simply swapping a couple lines.