Back to Content

HTMLTextAreaElement: placeholder property

files/en-us/web/api/htmltextareaelement/placeholder/index.md

latest624 B
Original Source

{{ APIRef("HTML DOM") }}

The placeholder property of the {{DOMxRef("HTMLTextAreaElement")}} interface represents a hint to the user of what can be entered in the control. It reflects the {{htmlelement("textarea")}} element's placeholder attribute.

Value

A string.

Examples

js
const textareaElement = document.getElementById("comment");
console.log(textArea.placeholder);

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{HTMLElement("textarea")}}
  • {{DOMXref("HTMLTextAreaElement.value")}}