-1
var scores = [0,0];
var activePlayer = '0';
var roundScore = '0';

document.querySelector('.dice').style.display = 'none';

this is the error in console

VM43 script.js:15 Uncaught TypeError: Cannot read property 'style' of null at VM43 script.js:15

VM43 script.js:15 Uncaught TypeError: Cannot read property 'style' of null at VM43 script.js:15

  • move script.js to bottom of page before

    , or add an onload event etc before firing off the selector.. or make sure you have added an element with `class="dice"`, the error explains the issue, 'style' of null, which means document.querySelector('.dice') is returning null, i.e its not found it

    – Lawrence Cherone May 17 '21 at 02:15

0 Answers0