function clearGrid() { for (let $square of $squares) { let $squareText = $square.querySelector('.square-text'); for (let cssClass of playerClasses) { code example
Example 1: js get element by attribute
//find all elements with "someAttr" attribute
document.querySelectorAll('[someAttr]')
Example 2: query selector js
element = document.querySelector(sélecteurs);