I\'ve tried to create a loop with a for, and increment by an onclick event, but it doesn\'t work.
A part of js :
var gameCase = [\'\', \'\', \'\', \
Another option is to use a forEach loop this creates a new variable for each iteration.
var gameCase = ['', '', '', '', '', '', '', '', ''], // 9 itemLists = $('game').getElementsByTagName('li'); // 9 items itemLists.forEach(function(item,index){ item.onclick = function() { // do something } });