Trying to get dropdown button to have content appear upon button click

I have the following function: it enables all the dropdown buttons to be clicked and show their content. I have three dropdown buttons. My link is as follows to reference my project: https://codepen.io/emilysarah1/pen/oNYEYmb

for (let i = 0; i < btn.length; i++) {
    const el = document.getElementById("myDropdown" + (i + 1));
    btn[i].addEventListener("click", function() {
      el.classList.toggle("show");
    });
 } ```


 I'm trying to call the function that will enable the "Add Event Date" (the final dropdown button) to show its content. Since the code above is not a named function, how to I call it within another function?   I wrote a function to try to do this, not sure I'm on the right track and I'm new to javascript.  Function is below:

function purchaseClicked() {
alert(‘Thank you for your purchase!’)

function() //pretty sure this is wrong

var cartItemContainer = document.getElementsByClassName('cart-items')[0]
while(cartItemContainer.hasChildNodes()) {
    cartItemContainer.removeChild(cartItemContainer.firstChild)
}
updateCartTotal()

}