I am facing an issue with a div
that should act like a button. When this div
is clicked, another hidden div
is supposed to be displayed. However, the behavior is not as expected. I have included the data data-toggle="dropdown"
attribute in the div
acting as a button. Can you help me understand what could be causing this problem?
Below is the code snippet:
function showsleevepanel() {
$('.option-panel').hide();
$('#sleeve-options-panel').show();
}
#sleeve-options-panel {
width: 17rem;
display: none
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div onclick="showsleevepanel()" class="card col-md-12 d-flex align-items-center justify-content-center mx-auto mb-2" data-toggle="dropdown">
<img class="menuIcon" id="menuIcon_sleeve" src="//cdn1.tailorstore.com/ui/emerald/choices/26/sleeve/3.svg"></img>
<span>Sleeve</span>
</div>