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 (2014) Creating a Password Confirmation Form Using next()

Jquery Code Help Needed

I don't know how to show code on the forum...I need help with Jquery. The challenge is to hide the password hint once the password has > 8 characters.

Edit==> I just figured it out! Even though it was the same code, I guess I needed to reload the browser to get it to work. Problem solved!

Dave McFarland
Dave McFarland
Treehouse Teacher

To put HTML/CSS/JavaScript in a forum post:

  1. hit return to create a new line and type three back tick characters ```

  2. hit return to create another new line and paste your HTML

  3. hit return and add three more back tick characters: ``` The back tick character isn't the same as the single quote -- ' -- mark; the back tick is located on the same key as the ~ on most keyboards.

Also to add correct color highlighting add the name of the language after the back ticks like this: ```CSS. Here's what CSS should look like in a forum post:

#gallery li {
  float: left;
  width: 45%;
}

6 Answers

Hi Annette - just click on Markdown Cheatsheet below the comment box and it will explain how to put code in comments:

        ```html
        <p>This is code!</p>
        ```
<p>Thanks so much, Aimee!</p>

'''js //Hide hints $("form span").hide(); //Find out if password is valid function passwordEvent() { if($(this).val().length > 8) { $(this).next().hide(); } else { $(this).next().show(); } }

$("#password").focus(passwordEvent).keyup(function() {

}); '''

Hint for the future when you do need to post code again:

You're using an apostrophe (') there but you should be using a backtick (`) -- it's usually right next to the 1 key on your keyboard :)

I tried posting the code per the instructions, but it didn't format correctly.

 //Hide hints $("form span").hide(); //Find out if password is valid function passwordEvent() { if($(this).val().length > 8) { $(this).next().hide(); } else { $(this).next().show(); } }

$("#password").focus(passwordEvent).keyup(function() {

}); 
            ```

'''html //Hide hints $("form span").hide(); //Find out if password is valid function passwordEvent() { if($(this).val().length > 8) { $(this).next().hide(); } else { $(this).next().show(); } }

$("#password").focus(passwordEvent).keyup(function() {

}); '''