Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

html
css
pattern
attribute
communitycreator

What is the pattern attribute HTML?

Behzad Ahmad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Overview

In HTMLHypertext Markup Language, the pattern attribute is used to specify the regular expression on which we check the pattern of input values. This attribute works with the <input> elements.

We use this attribute with the following input types: text, email, date, password, etc.

Syntax


<input pattern = "regular_expression">

Parameters

This attribute takes regular_expression as its single argument.

Example

Explanation

In the above example, we set the pattern of password type to accept a minimum of 6 characters. So, if we add fewer characters, it shows a warning message.

RELATED TAGS

html
css
pattern
attribute
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring