I'm trying to move a list item in a standard unordered list but have no idea where to start. I can't access the HTML and only have a client JS file so guess I would have to do it through JS.
The list looks like this:
<nav id="main_navigation">
<ul class="level_1 children_9">
<li class="level_1 first" id="1">
<a class="level_1" href="#">Item 1</a>
</li>
<li class="level_1" id="2">
<a class="level_1" href="#">Item 2</a>
</li>
<li class="level_1" id="3">
<a class="level_1" href="#">Item 3</a>
</li>
<li class="level_1" id="4">
<a class="level_1" href="#">Item 4</a>
</li>
<li class="level_1" id="5">
<a class="level_1" href="#">Item 5</a>
</li>
</ul>
</nav>
I want to move item 4 to where item 1 is and maintain the rest of the order.
The only examples I have found involve reorder on click which is way too complicated.
Any help here would be greatly appreciated.
Thanks,
Adam