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
Dave Fowler
Courses Plus Student 3,640 PointsForm Validation - Text Input Events.
I'm stuck on the code challenge.
The first bit asks me to hide the class of "hint" which I did by entering:
$(".hint").hide();
The next part asks me to : "Select all inputs and on the 'keydown' event select 'this' and then show the next element."
I have entered in:
$("input,text").focus(function(){ $(this).next().fadeIn("slow"); });
I get the following error message:
"You did not call next() on $(this) and showed the returned element."
I'm calling an input of "text," and am not sure what I've missed.
Help??
5 Answers
Dave Fowler
Courses Plus Student 3,640 PointsFigured it out!!!!
I entered in:
$("input,text").keydown(function(){
$(this).next().show();
});
Dave Fowler
Courses Plus Student 3,640 PointsI've also tried entering the following:
$("input,text").focus(function(){ $(this).next().keydown(function(){$("input")
}); });
Dave Fowler
Courses Plus Student 3,640 PointsJust tried entering this:
$(".hint").hide();
$("input,text").keydown(function(){ $(this). $("input")
});
The notification came up as "null."
Dave Fowler
Courses Plus Student 3,640 PointsIt seems like often times, less is more with code! I really made things overly complicated!
Andrew Chalkley
Treehouse Guest TeacherGlad you got there in the end.
Sometimes when you see null there may be a syntax error and our Code Challenge Engine can't parse something correctly.