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 trialAjay Yadav
Full Stack JavaScript Techdegree Graduate 18,261 PointsBug in code
i am not able to find out the bug in this code.this is not working properly. Please help me. here is the code..thank you $("form span").hide();
function passwordEvent(){ if (($(this).val().lenght) > 8) { $(this).next().hide(); } else{ $(this).next().show(); } } $("#password").focus(passwordEvent).keyup(passwordEvent);
1 Answer
ve
5,048 PointsI guess there's one bracket too much at the beginning of the first if-condition: "if(($(this)" should be "if($(this)".
Then, you have a spelling error in $(this).val().length. It's length, not lenght.
Let me know if it works now :)
Ajay Yadav
Full Stack JavaScript Techdegree Graduate 18,261 PointsAjay Yadav
Full Stack JavaScript Techdegree Graduate 18,261 PointsThanks Valerie Ernenwein for correcting me in silly mistake...thanks again