HTML input type password Tutorial

In this section, we will learn what the <input type = “password”> element is and how to use it.

What is input type password in HTML?

HTML <input type = “password”> element is used to create a field in a document where users can enter their secure data like passwords.

This is because the value we enter in this field is masked. So basically what you see when entering data to such a field is either a bunch of “*” or dots instead of the actual value.

In short, the input element of type password is mainly used when we want to have a form where users need to enter their sensitive data in a way that other people cannot see if they are looking at that document at the same time.

HTML input type password Syntax:

<input type = “password>

Example: using <input type=”password”> in HTML

See the Pen using <input type="password"> in HTML by Omid Dehghan (@odehghan) on CodePen.


Top Technologies