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 trialVeronika Kaufmann
Full Stack JavaScript Techdegree Graduate 15,918 PointsProblem with quiz question in Ajax Basics course. Involving jQuery element selection
A click event handler for all HTML button elements on a page is to be made using jQuery.
Code given: $(__).click(function(){});
I filled in the blank as so $(“button”).click(function(){});
My solution returns an error and I can’t figure out why.
I’d be thankful for any help with this
2 Answers
Steven Parker
231,236 PointsThat's the correct answer. Perhaps there was a typo when you entered it into the quiz.
If you still have trouble, try restarting your browser between attempts.
Update: I didn't notice this before, but the quote marks you have in your sample above are word-processing style "curly" quotes (or "smart quotes"). For programming (and quizzes), you need to use "straight" quotes.
Here's a sample in a larger font:
Use these " " not these “ ”
Veronika Kaufmann
Full Stack JavaScript Techdegree Graduate 15,918 PointsThanks for answering, Steven. Unfortunately I still get an error. I tried about a dozen times. A typo isn’t the issue here. I’m a little baffled to be honest.
Steven Parker
231,236 PointsI found the issue, and updated my answer.
Veronika Kaufmann
Full Stack JavaScript Techdegree Graduate 15,918 PointsVeronika Kaufmann
Full Stack JavaScript Techdegree Graduate 15,918 PointsI didn't even notice because when I typed the quotes on my tablet (which I was previously using to answer the questions), the quotes looked like straight quotes.
I changed to a laptop now, did it again and it finally worked. Thanks again.