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

Robbie Thomas
Robbie Thomas
31,092 Points

Selecting by ID: Challenge 1 of 2

Been on this for twenty minutes and still stumped, any help is appreciated.

let button = document.getElementbyId('sayPhrase');
let input = document.getElementbyId('phraseText');

button.addEventListener('click', () => {
<!DOCTYPE html>
    <title>Phrase Sayer</title>
    <p><input type="text" id="phraseText"></p>
    <p><button id="sayPhrase">Say Phrase</button></p>
    <script src="js/app.js"></script>

2 Answers

Adam Beer
Adam Beer
11,282 Points

Please fixed your code. You misspelled. What you wrote.


but the correct code is the


That's b with upper case. Hope this help.

Robbie Thomas
Robbie Thomas
31,092 Points

Forget it, found out the problem. For one thing, that let input shouldn't have that for part 1. And also, I forgot to use a capital B for getElementById in the first line.