Почему ячейка с классом "special" при клике окрашивается в желтый цвет, если есть условие не окрашивать if(!cell.classList.contains('.special'))

    <tr>
      <td class="cell one">Cell1</td>
      <td class="cell two">Cell2</td> 
      <td class="cell three">Cell3</td>
    </tr>
    <tr>
      <td class="cell four">Cell4</td>
      <td class="cell five">Cell5</td> 
      <td class="special cell six">Special Cell6</td>
    </tr>
    <tr>
      <td class="cell seven">Cell7</td>
      <td class="cell eight">Cell8</td> 
      <td class="cell nine">Cell9</td>
    </tr>
  </table> ```

> JS код
```specCell.addEventListener('click', () => {
    cells.forEach((cell) => {
        if (!(cell.classList.contains('yellow') || cell.classList.contains('blue')))    {   
            cell.classList.add('green');
        }
    }
)
})

    cells.forEach(cell => cell.addEventListener('click', () => {
            if (cell.classList.contains('one')) {
                cell.classList.add('blue');
            two.classList.add('blue');
            three.classList.add('blue');
        }
        if(cell.classList.contains('four')){
            cell.classList.add('blue');
            five.classList.add('blue');
            six.classList.add('blue');
        }
        if(cell.classList.contains('seven')){
            cell.classList.add('blue');
            eight.classList.add('blue');
            nine.classList.add('blue');
        } 
        if(!cell.classList.contains('.special')){           
            cell.classList.add('yellow');
        }
    }))

Ответы (0 шт):