How can I make the plus/minus sign clickable? It's not right now... How can I make the other button off (dropdown) if open when I click on the second button?
JAVASCRIPT
$(".dropbtn").append('<span class="adl-signs"> +</span>');
function ctaDropMenu(e) {
e.target.nextElementSibling.classList.toggle("show");
}
function toggleSigns(e) {
$(e.target).find('.adl-signs').html(function(_, html) {
return $.trim(html) == ' +' ? ' -' : ' +';
});
}
$(".dropbtn").click( function(e) {
ctaDropMenu(e)
toggleSigns(e)
});
// Close the dropdown if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {
var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}