$('[data-dropdown]').on('click', (e) => {
let dropdown = $(e.currentTarget).data('dropdown');
$(`#${dropdown}`).addClass('active');
})
$('body').on('click', (e) => {
if ( $(e.target).closest('.dropdown, [data-dropdown]').length == 0 ) {
$('.dropdown').removeClass('active')
}
})