Seeking assistance in creating a stylish combo box using CSS and jQuery. The combo box will contain 3 items, and I need guidance on how to select items within the combo box and display the selected item. Any help or suggestions would be greatly appreciated! Below is the snippet of my code:
$(function () {
$('#clickIcon').click(function() {
});
$("ul.dropdown li").click(function () {
$(this).addClass("hover");
$('ul:first', this).css('visibility', 'visible');
}, function () {
$(this).removeClass("hover");
$('ul:first', this).css('visibility', 'hidden');
});
$("ul.dropdown li ul li:has(ul)").find("a:first").append(" » ");
});
<div id="page-wrap">
<span>
<ul class="dropdown">
<li><a href="#">Cannot</a>
<ul class="sub_menu">
<li>
<a href="#">Can</a>
</li>
<li>
<a href="#">Must</a>
</li>
</ul>
</li>
</ul>
</span>
<span id="clickIcon" style="background-color: gray;padding-left: 5px;font-weight: 900;">
V
</span>
</div>