I'm trying to obtain the selected menu item from a ul dropdown list, but I'm not sure how to use PHP or JS to obtain the selected item.
The selected item needs to be submitted to the server-side with PHP. I know how to do it with a menu, but I need to use a ul
with li
items for my current CSS to work.
<div class="TypeListBox">
<div id="dd" class="wrapper-dropdown-3" tabindex="1">
<span>Food</span>
<ul class="dropdown">
<li><a href="#"><i class="fas fa-pizza-slice"></i></i>Pizza</a></li>
<li><a href="#"><i class="fas fa-pepper-hot"></i></i>Mexican</a></li>
<li><a href="#"><i class="fas fa-hamburger"></i></i>Burgers</a></li>
</ul>
</div>
</div>
I expect the ability to pass the selected item i.e. "pizza". How do I solve this problem?