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

This is the only question I can't answer. Please help.

Fill in the missing code to add a click event handler to all HTML button elements on a page:

I can't figure it out. I answered all of the other questions correctly.

3 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi Ja'Nel Sometime the simplest answer really is the right one. :)

The question just wants you to add the name of the element that is to be affected by the click() function. In this case it is "button" (make sure to include the quotes).

$("button").click(function() {

});

Keep coding!

Jason :)

Silly me. I forgot the double quotes. Lol.

I really don’t get this question. I have used: “button” ‘button’ button ‘#button’

But it keeps saying I’m wrong. Please help.

I am having the same problem

AJAX Basics Quiz Question 4 of 4

Please fill in the correct answer in each blank provided below. Bummer! Unfortunately, that answer is incorrect. Skip Quiz Review Video Get Help Finish Quiz Fill in the missing code to add a click event handler to all HTML button elements on a page: $(‘button’).click(function() {

});

Report Question

Please help if I put “button” with double quotes I still get the same response. What could be the problem