Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Michael Fazekas
3,070 PointsReferenceError: docment is not defined at HTMLButtonElement.
I'm trying to a simple to do app and I keep getting : ReferenceError: docment is not defined at HTMLButtonElement I've looked on stackOverFlow and Google tried a couple things still not working..
HERE IS JavaScript Code
const addItemInput = document.querySelector('input.addItemInput');
const addItemBtn = document.querySelector('button.addItemBtn');
const listContainer = document.querySelector('todo-container');
addItemBtn.addEventListener('click', ()=>{
const ul = docment.getElementsByTagName('ul')[0];
let li = document.createElement('li')
li.textContent = addItemInput.value;
ul.appendChild(li);
});
HTML will comment in.
2 Answers

Dmitry Polyakov
4,989 PointsInstead of docment should be document.

Michael Fazekas
3,070 PointsI need to get my eyes check 😂 I read right over it 10x’s didn’t even notice it
Thank you!

Michael Fazekas
3,070 PointsMaybe to if I paid attention to the reference error where it said docment lol
Michael Fazekas
3,070 PointsMichael Fazekas
3,070 PointsHTML code: