I have the following code to get the order of elements. But instead of getting an array in the order of the elements, it's alphabetical.
function gatherTreeIds( $parent ){
var GatheredIds = [];
$parent.children('div.nt_row').each(function(){
GatheredIds[ this.title ] = 'someValue';
});
return GatheredIds;
}
<div id="Wrap">
<div class="nt_row" title="AAA"></div>
<div class="nt_row" title="CCC"></div>
<div class="nt_row" title="BBB"></div>
</div>
Here is my jsFiddle example (check console for result). It gives me ['AAA','BBB','CCC']
instead of the desired ['AAA','CCC','BBB']
.
Important! This has to get recursive. It is not at this moment to simplify the problem.