I have this idea where I want to check if the class exists when the button is clicked, but using an array that way I don't have to write it like this:
$(".example1,.example2,.example3,.example4,.example5").click(function() {
myClass = $(this).attr("class").split(' ')[2];
BtnRank = $(this).index('button');
alert('BtnRank: '+BtnRank+' '+myClass);
return false;
});
Instead it would look like this:
var searches = ['.example1','.example2','.example3','.example4','.example5'];
What's the best approach to make this work properly?