HTMLTextAreaElement: selectionEnd ããããã£
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2015å¹´7æ.
selectionEnd 㯠HTMLTextAreaElement ã¤ã³ã¿ã¼ãã§ã¤ã¹ã®ããããã£ã§ã <textarea> è¦ç´ å
ã«ãããç¾å¨ã®ããã¹ã鏿ç¯å²ã®æ«å°¾ã®ä½ç½®ãæå®ãã¾ããããã¯ã鏿ãããããã¹ãã®æå¾ã®ã¤ã³ããã¯ã¹ãè¡¨ãæ°å¤ã§ãã <textarea> ã®é¸æãããããã¹ãã®æ«å°¾ã®ã¤ã³ããã¯ã¹ãåå¾ããããè¨å®ãããããéã«ä½¿ç¨ãããã¨ãã§ãã¾ãã
ä½ã鏿ããã¦ããªãå ´åã selectionStart ããã³ selectionEnd ã®å¤ã¯ãã©ã¡ãã <textarea> è¦ç´ å
ã®ã«ã¼ã½ã«ï¼ãã£ã¬ããï¼ã®ä½ç½®ã«ãªãã¾ãã
selectionEnd ãç¾å¨ã® selectionStart ã®å¤ããå°ããå¤ã«è¨å®ããã¨ãselectionEnd 㨠selectionStart ã®ä¸¡æ¹ã®ããããã£ããã®å¤ã«æ´æ°ããã¾ãã ã©ã¡ãã®å¤ã 0 æªæºã®å ´åã両æ¹ã®ããããã£ã textLength ããããã£ã®å¤ã«è¨å®ããã¾ãã
ãã®ããããã£å¤ã¯ããã® <textarea> ã«ãã©ã¼ã«ã¹ããªãã¦ãåå¾ãããè¨å®ããããããã¨ãã§ãã¾ãããè¦ç´ ã«ãã©ã¼ã«ã¹ããªãã¨ã ::selection æ¬ä¼¼è¦ç´ ã鏿ããã¹ãã¨ä¸è´ãã¾ããã
selectionEnd ãæ°ããå¤ã«è¨å®ããã¨ã selectchange ããã³ select ã¤ãã³ããçºçãã¾ãã
å¤
éè² ã®æ°å¤ã§ãã
ä¾
const textarea = document.getElementById("text-box");
const end = textarea.selectionEnd;
仿§æ¸
| Specification |
|---|
| HTML> # dom-textarea/input-selectionend> |
ãã©ã¦ã¶ã¼ã®äºææ§
é¢é£æ å ±
<textarea>HTMLTextAreaElementHTMLTextAreaElement.selectionStartHTMLTextAreaElement.selectionDirectionHTMLTextAreaElement.textLengthselectionChangeã¤ãã³ãHTMLTextAreaElement.select()HTMLTextAreaElement.setSelectionRange()HTMLTextAreaElement.setRangeText()HTMLInputElement.selectionEndSelection::selectionæ¬ä¼¼è¦ç´