Close all dropdown when another opens

Hello people

I am trying to write a jquery code to close all open dropdowns that have the combo class current and then give the new open dropdown the combo class current.

$('.dropdown__trigger').on('click', function() {
  $('.current').click();
  $('.dropdown__trigger').removeClass('current');
  $(this).addClass('current');
});

Here is my site Read-Only: https://preview.webflow.com/preview/diamantin?utm_medium=preview_link&utm_source=designer&utm_content=diamantin&preview=3c28290da1b15d919d8a7f7ffb0d3fef&workflow=preview
(how to share your site Read-Only link)

Are you looking for help? Does it work?

1 Like

@vincent I’m searching for help. It just doesn’t work.