<div memory="128-gb"></div>
<div memory="64-gb"></div>
<div memory="256-gb"></div>
<div memory="64-gb"></div>
<div memory="128-gb"></div>
<div memory="256-gb"></div>
<div class="memory" memory="128-gb">128-gb</div>
<div class="memory" memory="64-gb">64-gb</div>
<div class="memory" memory="256-gb">256-gb</div>
<script>
unordered = {};
keys = Array();
divs = document.querySelectorAll('.memory');
for(i=0; i<divs.length; i++){
keys[i] = divs[i].attributes.memory.nodeValue;
unordered[divs[i].attributes.memory.nodeValue] = divs[i];
parentCont = divs[i].parentNode;
divs[i].remove();
}
keys = keys.sort();
for(i=0; i<keys.length; i++){
parentCont.appendChild(unordered[keys[i]]);
}
</script>