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

ron yahav
ron yahav
6,018 Points

hints aren't showing

the hints aren't showing, am I missing something here?

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

//when event happenes on password input $("password").focus(function(){ //find out if password valid (>8 charechters) if($(this).val().length > 8) { //hide if valid $(this).next().hide(); // else show hint } else { $(this).next().show(); }


2 Answers

Colin Bell
Colin Bell
29,679 Points

Do you have it all on one line like that in your actual code? If so the double forward slash comments everything out that comes after it. Notice how everything after the first pair of forward slashes is green - meaning it's seen as a comment:

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

if($(this).val().length > 8) { //hide if valid $(this).next().hide(); // else show hint } else { $(this).next().show(); }

Breaking it into separate lines should work:

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

if ($(this).val().length > 8) {
    //hide if valid 
// else show hint 
} else {