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
Habiballah Hezarehee
7,193 PointsWhy my code is wrong? I have written this code for this challenge but it seems that something is not correct ...
Something is not correct and I need to edit it, but unfortunately I dont udnerstand which part of my code is incorrect. Could you please help me? I am trying to answer the second part of challenge (Adding class) in third part of jQuery Basics tutorial.
THE QUESTION IS:
- 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.
And my code is:
- const $submit = $('.submit-btn'); $submit.attr('disabled', true); $submit.addClass('disabled');
1 Answer
James Boone
5,919 PointsI assume you got this one figured out since this was almost a year ago lol but just in case anyone else has an issue. the task is calling for you to chain the two methods, so don't use a semi colon. Like this:
const $submit = $('.submit-btn'); $submit.attr('disabled', true).addClass('disabled');