Is there a simple method using only javascript to change the stacking order of two divs?
Assume I have the following four div elements:
<div id="div1">Div number 1</div>
<div id="div2">Div number 2</div>
<div id="div3">Div number 3</div>
<div id="div4">Div number 4</div>
With (pure) javascript, my goal is to swap the positions of div2 and div3 like this:
<div id="div1">Div number 1</div>
<div id="div3">Div number 3</div>
<div id="div2">Div number 2</div>
<div id="div4">Div number 4</div>
I've been struggling to find a solution for this...