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!
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

Andrew Schumacher
17,487 PointsSimple Email Validation Plugin
What's the problem with my code? <script type="text/javascript">
var isValid = $("input").validEmail();
$("textarea").validEmail(on:"keyup", success:function(){}, failure:function(){});
</script>
2 Answers

Tom Mertz
15,254 PointsHaha, yeah I got stuck at this part for so long.
I believe the validEmail method takes it's arguments as an array. See if that works.

Andrew Schumacher
17,487 PointsI'm not sure exactly what you mean by that. What would the syntax look like?

Tom Mertz
15,254 PointsRight now you are passing 3 arguments separately to validEmail separated by a comma:
validEmail(arg1, arg2, arg3);
But what you want is for those 3 arguments to be in an array
{arg1, arg2, arg3}
which would make the final code look like this:
$("textarea").validEmail( { on:"keyup", success:function() {}, failure:function() {} } );
Hope this helps.