Looking for assistance with a Dropdown menu that opens on mouse hover but needs to close when a link is clicked within the menu. Do you think JavaScript would be necessary for this function?
.dropdow {
position: relative;
display: inline-block;
width: 25%;
}
.gap {
text-align: center;
padding: 1em 0em;
background-color: #f47721;
margin-top: 6%;
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.16);
border-radius: 2%;
}
.dropbt1 {
background-color: #f47721;
color: white;
padding: 1px;
font-size: 13px;
border: none;
cursor: pointer;
}
.dropdow-content1 {
display: none;
position: absolute;
background-color: #f47721;
/* min-width: 160px; */
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.16);
z-index: 1;
}
.dropdow-content1 a {
color: white;
padding: 8px 3px;
text-decoration: none;
display: block;
}
.dropdow-content1 a:hover {
background-color: #d86a1e
}
.dropdow:hover .dropdow-content1 {
display: block;
width: 100%;
}
<div class="dropdow">
<div class="gap">
<h3>Dropdown Menu</h3>
<button class="dropbt1"><h3>Please Choose</h3></button>
<div class="dropdow-content1">
<a href="#" id="" class="specialLink">Option 1</a>
<a href="#" id="" class="specialLink">Option 2</a>
<a href="#" id="" class="specialLink">Option 3</a>
</div>
</div>
</div>
Seeking guidance on closing a Dropdown menu that opens with mouse hover when a link within the menu is clicked. Would implementing JavaScript be necessary for this functionality?