I am in the process of making a website responsive and I am faced with the task of combining two different menus. In order to achieve this, I need to transfer all list items (li) from one unordered list (ul) to another.
Provided below is a simplified version of the current markup:
<ul class="navigation-menu">
<li>...</li>
<li>...</li>
<li>...</li>
</ul>
<ul class="nav-bar">
<li>...</li>
<li>...</li>
<li>...</li>
</ul>
The goal is to append all list items from nav-bar at the end of the navigation-menu list and then hide the nav-bar from being visible on the web page.
This is my attempted solution:
$('ul.nav-bar li').each(function() {
$(this).after('ul.nav-bar:last-child');
}
I am uncertain about how to go about solving this issue. Any guidance or pointers in the right direction would be greatly appreciated.