this is my code:
$(document).ready(function() {
for( var i = 0 ; i < 8 ; i++ ){
for( var j = 0 ; j < 8 ; j++ ){
var $class = getPieceName(board[i][j][0])
$(.$class ????).click(function() {
$(this).css('background-color', 'red');
});
}
}
});
As you can see, I want to change the background color of an element. The for-loops are needed to get the element, in an array, which the user clicked on. How to write the variable ($class) as a class?