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 AJAX Basics (retiring) AJAX and APIs Review jQuery: Part 2

Veronika Kaufmann
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Veronika Kaufmann
Full Stack JavaScript Techdegree Graduate 15,918 Points

Problem 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
Steven Parker
231,236 Points

That'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 :point_right: " "   not these :point_right: “ ”

Veronika Kaufmann
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Veronika Kaufmann
Full Stack JavaScript Techdegree Graduate 15,918 Points

I 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.

Veronika Kaufmann
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Veronika Kaufmann
Full Stack JavaScript Techdegree Graduate 15,918 Points

Thanks 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
Steven Parker
231,236 Points

I found the issue, and updated my answer. :arrow_heading_up: