HTMLTextAreaElement: selectionStart property

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{APIRef("HTML DOM")}}

The **selectionStart** property of the {{domxref("HTMLTextAreaElement")}} interface specifies the start position of the current text selection in a {{HTMLElement("textarea")}} element.

For general information about this property, see {{domxref("HTMLInputElement.selectionStart")}}.

Value

A non-negative number representing the zero-based index of the first selected character, or the caret position if no text is selected.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{HTMLElement("textarea")}}
  • {{domxref("HTMLTextAreaElement")}}
  • {{domxref("HTMLTextAreaElement.selectionEnd")}}
  • {{domxref("HTMLTextAreaElement.selectionDirection")}}
  • {{domxref("HTMLTextAreaElement.selectionchange_event", "selectionchange")}} event
  • {{domxref("HTMLTextAreaElement.select()")}}
  • {{domxref("HTMLTextAreaElement.setSelectionRange()")}}
  • {{domxref("HTMLTextAreaElement.setRangeText()")}}
  • {{domxref("HTMLInputElement.selectionStart")}}
  • {{domxref("Selection")}}
  • {{cssxref("::selection")}} pseudo-element