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

Alan Sea
Alan Sea
6,781 Points

Why won't my "hints" hide? Console throws no errors...?

https://w.trhou.se/tf1njdutft

Won't even hide on page load, and that's a fairly straightforward call...?

Billy Bellchambers
Billy Bellchambers
21,689 Points

Check your else function I think you might be missing a closing ) in there

3 Answers

Billy Bellchambers
Billy Bellchambers
21,689 Points

If your still struggling to find the correction look below.

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

//When event occurs on password input
$("#password").focus(function() {
     //Find out if password is valid
    if($(this).val().length > 8) {
        //If yes, hide hint
        $(this).next().hide();
    }
        //If no, show hint
    else {
        $(this).next().show();  //you had a missing closing bracket on '$(this)'
  }
});

This should now work

Alan Sea
Alan Sea
6,781 Points

Thanks for the heads up...

Alan Sea
Alan Sea
6,781 Points

Sadly, I spoke too soon--doesn't seem to have fixed the issue.

Uros Tadic
Uros Tadic
5,167 Points

You need to also refresh the page you are looking, not only to save the js file. I think that is your problem :D