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

jQuery basics/Working with jQuery Collections/adding and removing classes/ quiz question one of 2

Select the submit button by its class and save it to a variable called $submit. Then use the appropriate jQuery method to disable the button by adding a disabled attribute to it.

const $submit = .attr('.submit-btn').disabled, true );

2 Answers

I think your code should looks something like this:

const submit = $('.submit-btn').attr('disabled', true );

That doesnt work

I went to the quiz and solved the problem like this:

var $submit = $('.submit-btn'); $submit.attr('disabled', true );

The staments says to first "Select the submit button by its class and save it to a variable called $submit" and then add the attribute.

Have a nice day.

thanks