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

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>