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 Build an Interactive Website jQuery Plugins Simple Email Validation Plugin

Brian Schmitz
Brian Schmitz
11,167 Points

Help with adding the validEmail plugin please. Thank you!

<script> var isValid = $("input.text").validEmail({on:"keyup", success:function() { $(this).next().removeClass('error').addClass('valid');
}, failure: function() { $(this).next().removeClass('valid').addClass('error'); }); </script>

1 Answer

Hi Brian,

You have added more code than requested in the challenge and it doesn't look like you are selecting the textarea element.

This was what I passed with:

var isValid = $('input[type="text"]').validEmail();
                              success: function() {
                              }, failure: function() {
Brian Schmitz
Brian Schmitz
11,167 Points

Thanks Jason, appreciate the help.