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 trialron yahav
6,018 Pointshints 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
29,679 PointsDo 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
$(this).next().hide();
// else show hint
} else {
$(this).next().show();
}