JavaScript JavaScript and the DOM Getting a Handle on the DOM Selecting by Id

Shardul Nandapurkar
Shardul Nandapurkar
969 Points

Incorrect code

Don't understand whats wrong with my code.I have made a correct reference to the HTML code with the correct id.could anyone help?

js/app.js
let button = document.getElementById ("sayPhrase");
let input = doucument.getElementById ("phraseText");


button.addEventListener('click', () => {
  alert(input.value);
});
index.html
<!DOCTYPE html>
<html>
  <head>
    <title>Phrase Sayer</title>
  </head>
  <body>
    <p><input type="text" id="phraseText"></p>
    <p><button id="sayPhrase">Say Phrase</button></p>
    <script src="js/app.js"></script>
  </body>
</html>
Aurelian Spodarec
Aurelian Spodarec
10,785 Points

It has a different highlight. Pay attention to those. And give that guy best answer :)

1 Answer

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 49,975 Points

You misspelled document in your input declaration

let input = doucument