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

Uncaught typeError

I keep throwing an Uncaught TypeError. It seems to appear at this time:

$password.focus(passwordEvent).keyup(passwordEvent)

Here is where I define that function earlier in the code:

var $password = ("#password");

function passwordEvent() { //find out if pw is valid if($password.val().length > 8) { //hide hint if valid $password.next().hide(); } else { //else show hint $password.next().show(); } }

any help at all is greatly appreciated

2 Answers

Fred Sites
Fred Sites
11,151 Points

Are you able to see a line number for the error in the console to pin point which line it is on? Once you find the line, work backwards, character by character.

You'll probably have better luck posting this in the javascript category, right now it's posted under css. Feel free to post more code if you're still having trouble.

Thanks Fred,

Sorry for the mis-categorization. Yes, I can see in the console and I've tried to debug it... I'll keep at it :-)

I actually forgot the dollar sign in declaring the variable... Thanks for the help.