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

Patrick Seamars
7,574 PointsAdding an "Erase" button to Simple Drawing App - How-To
I've been looking around to find a way to add a button to my Simple Drawing App project in the jQuery Basics course, to no avail. I tried a little bit on my own, but all I could do was append a button to the end of the div containing the canvas.
Where do I go next?
I appreciate your time.
2 Answers

Hugo Paz
15,622 PointsMy suggestion would be to create a button with the color of the canvas. Then use a slider to set the line width, the size of the eraser if you like. You can set it like this context.lineWidth = x;, where x is the value on the slider.

Anthony Ho
10,228 PointsHow do I get different brush textures other than lineWidth? Would I have to download a plugin?