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! While you're at it, check out some resources Treehouse students have shared here.
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 trialGesang Lamu
2,742 PointsgetElementByTagName give error in my console
I downloaded the HMTL, CSS file and everything. So started working on my local computer but
var addButton = document.getElementByTagName("button")[0];
give an error in my console? it does not give me the first button element.
While the instructor was not getting error, i was following step by step.
What might be wrong?
Thanks,
1 Answer
eck
43,038 PointsYou are missing the s in "Elements" Should look like:
document.getElementsByTagName("button")[0];
Gesang Lamu
2,742 PointsGesang Lamu
2,742 PointsOMG! thats it.... thanks!! I was looking through the HTML file
eck
43,038 Pointseck
43,038 PointsNp! Typos are easy mistakes to make and we all make them :P