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
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
