i have a html Page with a specific order, for instance:
<div id="three"></div>
<div id="two"></div>
<div id="one"></div>
But i need order it, i can touch the html, so, the idea is use Javascript/Jquery to do that, is there a way to make that without touch the html?
with jQuery:
this way you have, div 3, 1, 2 in that order.
You are selecting one of the divs, and selecting it’s parent. then you append them at the order you want.
if you want to use pure javascript:
now, assuming you have a lot of divs, i will assume #one til #ten:
you can create an array, with the ids ordered as you wish, for example:
is this what you’re looking for?