How would I go about reordering divs without altering the HTML source code?
example, I want divs to appear in order #div2, #div1, #div3, but in the HTML they are:
You could do, in Javascript:
function reOrder() {
divOne = document.getElementById('#div1');
divTwo = document.getElementById('#div2');
divThree = document.getElementById('#div3');
container = divOne.parentNode;
container.appendChild(divTwo);
container.appendChild(divOne);
container.appendChild(divThree);
}
Edit: Fixed typo in IDs.