EDITABLE CODE:
LiveDemo: JavaScript Form Validation : Check Email and Password
Note:Enter a value for password less than 8 characters to see the effects.