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 trialGerax Sotelo
5,879 PointsLine color does not start off red.
Everything seems to be working fine; however, when I first test the page, the initial drawing color is black. The red circle has the white ring around it as if it is selected, but I have to click on it first to actually draw in red. Shouldn't it start off with red like in the video? https://w.trhou.se/p94rh24vff
1 Answer
Iain Simmons
Treehouse Moderator 32,305 PointsOn line 3 of your app.js
you have the following:
var color = $("selected").css("background-color");
You're missing the dot/period to make it a class selector, so it's looking for a HTML tag/element selected
instead.
Update to the following, save the file, refresh the preview with Ctrl+Shift+R or Ctrl+F5, and it should work:
var color = $(".selected").css("background-color");
Gerax Sotelo
5,879 PointsGerax Sotelo
5,879 PointsThanks! That did it!