JavaScript AJAX Basics (retiring) AJAX and APIs Review jQuery: Part 2

Veronika Kaufmann
PRO
Veronika Kaufmann
Full Stack JavaScript Techdegree Graduate 15,912 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
172,090 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
Veronika Kaufmann
Full Stack JavaScript Techdegree Graduate 15,912 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
PRO
Veronika Kaufmann
Full Stack JavaScript Techdegree Graduate 15,912 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
172,090 Points

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