var selected = gameContainer.querySelectorAll('.selected');
if(selected.length == 2){
for(let i=0;i<selected.length;i++){
selected[i].classList.remove('selected');
}
}
console.log(selected.length);
this.classList.add('selected');
Array
(
[0] => Array
(
[product_id] => 825
[category_id] => 84
[main_category] => 0
)
[1] => Array
(
[product_id] => 825
[category_id] => 85
[main_category] => 0
)
[2] => Array
(
[product_id] => 825
[category_id] => 86
[main_category] => 0
)
)