files/en-us/web/api/htmloptionelement/text/index.md
{{ApiRef("HTML DOM")}}
The text property of the {{domxref("HTMLOptionElement")}} represents the text inside the {{htmlelement("option")}} element.
This property represents the same information as {{domxref("Node.textContent")}}.
[!NOTE] If the element has a
label, the text inside the {{htmlelement("option")}} is not visually rendered. In this case, thetextproperty can still be used to set the content, but it will have no visible effect.
A string.
const optionElement = document.getElementById("exampleOption");
console.log(`Text property: ${optionElement.text}`);
optionElement.text = "Updated text";
{{Specifications}}
{{Compat}}