Input URL placeholder attribute

Definition and Usage

placeholder Sets or returns the value of the placeholder attribute of the URL field.

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

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

This attribute reflects the HTML placeholder attribute.

See also:

HTML Reference Manual:HTML <input> placeholder-Attribut

Example

Example 1

Change placeholder text for URL field:

document.getElementById("myURL").placeholder = "Please enter the URL here...";

Try it yourself

Example 2

Get placeholder text for URL field:

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

Try it yourself

Syntax

Return placeholder attribute:

urlObject.placeholder

Set placeholder attribute:

urlObject.placeholder = text

Attributswert

Wert Beschreibung
text Beschreibt eine kurze Erklärung (Wort oder Phrasen) für die erwartete URL-Feldwerte.

Technische Details

Rückgabewert: Zeichenfolgenwert, der eine kurze Erklärung für die erwartete URL-Feldwert beschreibt.

Browser-Unterstützung

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Unterstützt 10.0 Unterstützt Nicht unterstützt Unterstützt