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

Not calling the 'attr' method?

Hey guy's,

I've never done Javascript before, so I've finally hit that topic after familiarizing myself again with html/css.

I've hit an issue that's frankly hurting my head. In the challenge, it's asking me to add the attribute of "checked" with the value of "checked" to the id of "accept".

I must be doing this wrong, but I'm thinking it's right..

Here's what I'm putting:

$("input").addClass("valid");
$("input").removeClass("error");
$("#accept").attr("checked", "checked");

I "think" I'm calling the .attr method but apparently I'm not, any help?

Thanks, Vaughan

3 Answers

Wow I'm so silly! Forget this post, I had put in "chcked" for the value instead of "checked".

Man I hate typo's! Glad I was doing it right though, I thought I was going crazy.

Nick Pettit
STAFF
Nick Pettit
Treehouse Teacher

Hey Vaughan,

Glad you were able to solve this! Coding is tricky, but it sounds like you have the patience and sense of humor for it. :)

Funny, that's the most gratifying part of coding for me. Being annoyed by a problem for 20 minutes only to realize it's something so simple. Grats on the solution!