input type, you should supply a pattern for browsers that don't support this input type.
Email validation regex patterns are a hotly debated issue.
:[a-z A-Z\u00a1-\uffff0-9]-*)*[a-z A-Z\u00a1-\uffff0-9] )(? You can style fields that have errors on them with the pseudo-selector, but you can't style the error messages themselves. Chrome doesn't display any errors until you try to submit the form.
Support for the various input types and attributes varies wildly from browser to browser, but I'll provide some tricks and workarounds to maximize browser compatibility.
Let's say you have a text field that is required for a user to fill out before the form can be submitted.
User studies from Christian Holst and Luke Wroblewski (separately) found that displaying an error when the user leaves a field, and keeping that error persistent until the issue is fixed, provided the best and fastest user experience.
Firefox displays a red border when the field loses focus, but only displays error messages on hover (whereas Web Kit browsers keep the errors persistent).
Most Java Script form validation libraries are large, and often require other libraries like j Query.
For example, Mail Chimp's embeddable form includes a 140kb validation file (minified).
Add the attribute let's you run regex validations against input values.
If you, for example, required passwords to contain at least 1 uppercase character, 1 lowercase character, and 1 number, the browser can validate that for you.
If you want to require a TLD (and you likely do), you can modify the input type will alert users if the supplied value is not a valid URL.