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

Stuck on Jquery code challenge.Please help

stuck on question -

"Open a new script tag and using the "validEmail" plugin, store in a variable "isValid" whether the email address in the text input is valid."

my code -

 <script type="text/javascript" src="validEmail.js"></script>
  <script type="text/javascipt"> 
$("input").validEmail({on:"keyup", success:function(){
     var isValid = true;
    } });
  </script>

Returns - Bummer! The validEmail method wasn't called on input

I can't understand what is wrong here, would appreciate any input.

4 Answers

Take ou the keyup success function stuff. Also did you remember to add validEmail like you would do with jquery?

I don't have the exact link on front of me, but I'm very certain this code challenge has appeared before in the Forum. When I get stuck, I always search , say "jQuery code challenge validEmail", to see what others came up with before.

Andrew Chalkley
STAFF
Andrew Chalkley
Treehouse Guest Teacher

Here's a hint:

var isValid = /* code here */

Check out the first usage example on the documentation page.

Regards, Andrew

Thanks everyone for your help. managed to pass the challenge finally