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 trialBruno Dias
10,554 Pointsprint function not working
I am trying to practice the print message but not sure what's wrong here:
2 Answers
adamdonatello
27,485 PointsHi Bruno,
You just need to adjust your function slightly. You are missing some syntax from your getElementById.
function print(message){
var div = document.getElementById('myDiv');
div.innerHTML = message;
}
Hope that helps!
Grace Kelly
33,990 PointsHi Bruno, you're missing document. before the getElementById();, you also have mispelled getElementById() in your code
Bruno Dias
10,554 PointsThanks Grace.
Bruno Dias
10,554 PointsBruno Dias
10,554 PointsHey Adam, Thank you for your help. I was missing the "document." Still practicing JS. It's quite difficult when you come from a design background but I'll get there. =)