Form Validation Attributes
Introduction to HTML
Basic HTML Document Structure
Headings
Paragraphs
Line Break and Horizontal Rule
Text Formatting Tags
Comments
Attributes
Links
Open Link in New Tab
Images
Image as Link
Favicon
Lists
Ordered Lists
Description Lists
Nested Lists
Tables
Table Caption and Spanning
Block and Inline Elements
div Element
span Element
Semantic HTML
Layout Elements
Forms
Input Types
Labels
Radio Buttons and Checkboxes
Select and Option
Textarea
Button
Fieldset and Legend
Datalist
Output Element
Form Validation Attributes
Audio
Video
iframe
embed Element
Figure and Figcaption
Details and Summary
Progress and Meter
Time and Data Elements
Canvas
SVG
Responsive Images
Accessibility Basics
SEO-Oriented HTML
Global Attributes
Event Attributes
Image Map
Iframe for Maps or Video
Metadata and Head Elements
HTML Entities, Symbols, and Emojis
Deprecated and Legacy Tags
Form Validation Attributes
35. Form Validation Attributes
HTML5 includes built-in validation features such as required, min, max, pattern, and type-based validation. These reduce the need for simple validation scripts.
Syntax
<input type="email" required>
Example
<form>
<input type="email" required placeholder="Enter email">
<input type="submit">
</form>
Output
The browser blocks submission if the email field is empty or invalid.
Example
Executing...
❌ Error:
✅ Output:
// Click Run ▶ to execute
🏋️ Test Yourself With Exercises
Take our quiz on Form Validation Attributes to test your knowledge.
Browse Quizzes »