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 trial

JavaScript jQuery Basics (2014) Creating a Simple Drawing Application Perform: Part 3

nishnash
nishnash
6,267 Points

Cannot Add Color (nothing happens on click)

Hi,

Not sure what i'm doing wrong. When I select 'add color' after adjust the ranges, nothing happens on click.

Went over the code several times but cannot find what i'm doing wrong..

https://w.trhou.se/7krq1zjj73

2 Answers

Steven Parker
Steven Parker
229,644 Points

:point_right: An element ID must be prefixed by a pound sign (#).

On line 36, you selected "addNewColor" as if it were a tag name. It needs to be prefixed by a pound sign:

// When we press add color 
$("#addNewColor").click(function() {
nishnash
nishnash
6,267 Points

wow, thanks so much... scanned it so many times looking for errors and couldn't find anything... guess i need a rest ....

Thanks Steven... That was a quick catch and reply :)