Guest User

Untitled

a guest
Oct 17th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. HTML:
  2.  
  3. <form id="emailfill">
  4. <input type="email" id="my-text-input" />
  5. <input type="submit" />
  6. </form>
  7.  
  8. JS:
  9.  
  10. $('#emailfill').on('submit', function(event) {
  11. event.preventDefault();
  12. if ( $('#my-text input').val() == '') {
  13. alert('You missed the field.');
  14. } else {
  15. alert('Thanks for filling the field!');
  16. }
  17. })
Add Comment
Please, Sign In to add comment