Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HTML:
- <form id="emailfill">
- <input type="email" id="my-text-input" />
- <input type="submit" />
- </form>
- JS:
- $('#emailfill').on('submit', function(event) {
- event.preventDefault();
- if ( $('#my-text input').val() == '') {
- alert('You missed the field.');
- } else {
- alert('Thanks for filling the field!');
- }
- })
Add Comment
Please, Sign In to add comment