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 Perform: Part 1

Can not get the hint to hide

This doesn't hide the hint even after the password's value has crossed the length of 8

 //Hide hints
$("form span").hide();

//When event happens on password input
$("#password").focus(function(){
    //Find out if the password is valid
    if($(this).val().length > 8) {
        //Hide hint if valid
        $(this).next().hide();
    } else {
        //else show hint
        $(this).next().show();
    }
});

2 Answers

Your code seems correct but you need something to trigger the function to check the form field at every key press, otherwise this just runs when you focus (or click) on the password field. I'd take another gander at the video.