HTMLInputElement: placeholder property
HTML DOM
HTML DOM
The placeholder property of the HTMLInputElement interface represents a hint to the user of what can be entered in the control. It reflects the input element's placeholder attribute.
Value
A string.
Examples
const inputElement = document.getElementById("phone");
console.log(inputElement.placeholder);
Specifications
Browser compatibility
See also
- input
- HTMLInputElement.value
- ::placeholder pseudo-element
- :placeholder-shown pseudo-class