Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

General Discussion

Patrick Johnson
Patrick Johnson
9,505 Points

jQuery Form Validation First Lesson

Hi All,

Running into issues in the first video of the jQuery form validation lessons.

I've pulled the project files from the video page, removed all the existing code as I wanted to write it myself.

Currently, even when writing the code exact to the video, my <span> tags aren't showing.

Here's my code:

<script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript">
        $("#form span").hide();
        $("input").focus(function(){
            $(this).next.fadeIn("slow");
        });
</script>

Am I possibly using the wrong code set? Or a finalized version of the source code that has since changed from that first video?

Thanks in advance.

pbj

2 Answers

John Wheal
John Wheal
27,969 Points

Have you defiantly copied the jquery.js file?

Try including the parenthesis after 'next'

<script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript">
        $("#form span").hide();
        $("input").focus(function(){
            $(this).next().fadeIn("slow");
        });
</script>