
Veronika 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
177,891 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
177,891 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.