MDN self-hosted library · e01.org

What went wrong? Troubleshooting JavaScript

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
   guessSubmit.addeventListener("click", checkGuess);
js
   lowOrHi.textContent = "Last guess was too high!";
js
   const lowOrHi = document.querySelector("lowOrHi");
js
   console.log(lowOrHi);
html
   <p class="lowOrHi"></p>
js
   let randomNumber = Math.floor(Math.random()) + 1;
js
   randomNumber = Math.floor(Math.random()) + 1;
js
   console.log(randomNumber);
js
Math.random();
js
Math.floor(Math.random()) + 1;
js
Math.floor(Math.random() * 100);
js
Math.floor(Math.random() * 100) + 1;
js
} else if (guessCount === 10) {
js
} else if (guessCount = 10) {
js
function checkGuess() {
js
function checkGuess( {