![]() |
VOOZH | about |
The HTML pattern attribute is used with <input> elements to specify a regular expression that the input's value must match for the form to be submitted. It enforces specific formatting rules, like requiring a certain number of characters or specific character types.
Syntax:
<input pattern = "regular_exp">Element: This attribute is associated with <input> element only.
Attribute: This attribute specifies the regular expression.
Example: In this example we use the pattern attribute to enforce a three-letter password. The input must match the specified pattern of three alphabetic characters, or it will not submit.
Output :
Supported Browsers: The browser supported by pattern attribute are listed below: