I have a large amount of buttons all used to display a div before it, my question is instead of having 20 different javascript functions which all do the same thing, is it possi
You could write a function like this:
function yourfunction(id1, id2) {
document.getElementById(id1).addEventListener("click", function(){
document.getElementById(id2).style.display="block";
});
}
And call it in your script:
yourfunction("#drop-button", "#dropdown");
yourfunction("#drop-button1", "#dropdown1");
// more ids