Input Password placeholder attribute

Definition and usage

placeholder Set or return the value of the placeholder attribute of the password field.

The HTML placeholder attribute specifies a brief prompt describing the expected value of the password field (for example, a sample value or a brief description of the expected format).

A brief prompt will be displayed in the password field before the user enters a value.

See also:

HTML reference manual:HTML <input> ƙanƙuwarin placeholder

Example

Example 1

Change the placeholder text of the password field:

document.getElementById("myPassword").placeholder = "Please enter your password";

Try it yourself

Example 2

Get the placeholder text of the password field:

var x = document.getElementById("myPassword").placeholder;

Try it yourself

Syntax

Return placeholder attributes:

passwordObject.placeholder

Tasiri placeholder attributes:

passwordObject.placeholder = text

Kuduwar ƙarfi a ƙarfi

Kuduwar ƙirar Ƙarfin ƙarfi
text Ƙarfin ƙarfi ƙaƙalba mai ƙarfi ƙaƙalba a ƙarfi (kalmar ko wareware).

Ƙarfin ƙarfi

Kuduwar ƙirar: Kuduwar ƙirar, wanda nufin ƙirar ƙaƙalba mai ƙarfi ƙaƙalba a ƙarfi.

Girmamawa a ƙarfi

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Narawa 10.0 Narawa Narawa Narawa