Input Email placeholder Attribute

Definition and Usage

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

The HTML placeholder attribute specifies a short hint that describes the expected value of the email field (for example, a sample value or a brief description of the expected format).

A short hint will be displayed in the text field before the user enters a value.

See also:

HTML Reference Manual:HTML <input> placeholder Atribute

Example

Example 1

Change the placeholder text of the email field:

document.getElementById("myEmail").placeholder = "Your Email address";

Try it yourself

Example 2

Get the placeholder text of the email field:

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

Try it yourself

Syntax

Return the placeholder attribute:

emailObject.placeholder

Set the placeholder attribute:

emailObject.placeholder = text

Halaga ng Atribute

Halaga Paglalarawan
text Tinutukoy ang maikling paalaala (salita o parirala) ng inaasahang halaga ng email field.

Detalye ng Teknolohiya

Halaga ng Bumalik: String na halaga, na naglalarawan ng maikling paalaala ng inaasahang halaga ng email field.

Suporta ng Browser

Ang numero sa tabli ay naglalarawan ng unang bersyon ng browser na ganap na sumusuporta sa katangian na iyon.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Suporta 10.0 Suporta Suporta Suporta