How do I remove an element from its position and reallocate it in the DOM?
For example: in a <ul>
, bring the last <li>
to the top / first position.
I saw this in jQuery, with the function appendTo()
, and would like to know how to do the same with pure javascript.