You can' refer a variable using another variable like that, instead you can use an object as given below
var counter = {
one: 0,
two: 0
}
$('.selectable').on('click', function () {
// tell me what pool you are
var thispool = $(this).attr("data");
// you are now activated
$(this).toggleClass('activated');
//add +1 if activated, else -1
if ($(this).hasClass('activated')) {
counter[thispool]++;
} else {
counter[thispool]--;
}
});
Demo: Fiddle