Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
218,813 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
218,813 Points

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