In html5 fields can be valid. (for example an type="email" has to follow the email convention etc).
Using css you can select valid fields with the psuedo-element:
input:valid.
Is it possible to trigger an event when the input becomes valid?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the
checkValidity()method on the input’s DOM element you want to check.Then you can run that function on whatever event, like
blurorkeyupor a button.Demo: http://jsfiddle.net/nSLQb/1/