is there a way using CSS or javascript to put div.blue in the position of div.red
or div.red in the position of div.blue
Comments
Comment posted by searching on your own
Yes there is. But if that’s not the answer you wanted, you’ll have to rewrite your question a bit because DOM manipulation using JS is a pretty basic topic and has
Comment posted by stackoverflow.com/a/48205947/2138752
This may help you:
Comment posted by Jeff Vdovjak
From your example, you don’t need to use javascript — but if you do (for whatever reason) it’s fairly simple.
Comment posted by Joseph Oikelomen
but this only swaps 2 elements what if I have multiple boxes on my website and I wanted to arrange them anyhow I wanted to, for example, => [div1, div2, div3, div5, div5] can be customized to give => [div4, div1, div3, div2, div5]