web api instance property
HTMLInputElement: placeholder property
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(input.placeholder);
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.
See also
<input>value::placeholderpseudo-element:placeholder-shownpseudo-class