Is there a way to group several variables and click events into one function?
I'd like to only have one function that would call all the classes with the same name but different numbers (from 1 to 3 in this case) so I don't have to make multiple functions like this:
function step1() {
$("#step-1").fadeIn();
}
function step2() {
$("#step-2").fadeIn();
}
function step3() {
$("#step-3").fadeIn();
}
And
$("#step-1-btn").click(function(){
step1();
});
$("#step-2-btn").click(function(){
step2();
});
$("#step-3-btn").click(function(){
step3();
});
I'm sure there is an answer to this question already, but I can't phrase it good enough to find it...