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

Did you make a call to the "addClass" method after calling the "attr" method on the variable named "$submit"?

Challenge Task 2 of 2

The submit button is now disabled, but it doesn’t look like it! Luckily, we have a class called disabled in our CSS that will style it for us. Chain the appropriate jQuery method to add the class of disabled to the submit button.

Bummer: Did you make a call to the "addClass" method after calling the "attr" method on the variable named "$submit"?

my code : const $submit = $('.submit-btn'); $submit.attr("disabled", true) $submit.addClass(' disabled')

what is wrong here?

1 Answer

Tim Knight
Tim Knight
28,888 Points

Ahmed,

I'm not sure about the specific challenge you're on since I'm not sure the course you're taking here, but have you tried chaining the method calls together? Something like, this:

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