• Skip to main content
  • Skip to search
  • Skip to select language
    • Technologies Overview
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs
    • Browser Extensions
    • MathML
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
    • Send Feedback
    • Contribute to MDN
    • Report a content issue 🌐
    • Report a platform issue 🌐
  1. Web technology for developers
  2. Web APIs
  3. Selection
  4. Selection.collapseToStart()
  • Change language

Table of contents

  • Syntax
  • Specifications
  • Browser compatibility
  • See also

Selection.collapseToStart()

The Selection.collapseToStart() method collapses the selection to the start of the first range in the selection. If the content of the selection is focused and editable, the caret will blink there.

Syntax

sel.collapseToStart()

Parameters

None.

Specifications

Specification
Selection API
# dom-selection-collapsetostart

Browser compatibility

BCD tables only load in the browser

See also

  • Selection, the interface it belongs to.

Found a problem with this page?

  • Edit on GitHub
  • Source on GitHub
  • Report a problem with this content on GitHub
  • Want to fix the problem yourself? See our Contribution guide.

Last modified: Mar 12, 2022, by MDN contributors

Change your language

Related Topics

  1. Document Object Model
  2. Selection
  3. Properties
    1. anchorNode
    2. anchorOffset
    3. focusNode
    4. focusOffset
    5. isCollapsed
    6. rangeCount
    7. type
  4. Methods
    1. addRange()
    2. collapse()
    3. collapseToEnd()
    4. collapseToStart()
    5. containsNode()
    6. deleteFromDocument()
    7. extend()
    8. getRangeAt()
    9. modify()
    10. removeAllRanges()
    11. removeRange()
    12. selectAllChildren()
    13. setBaseAndExtent()
    14. toString()
  5. Related pages for DOM
    1. AbortController
    2. AbortSignal
    3. AbstractRange
    4. Attr
    5. ByteString
    6. CDATASection
    7. CharacterData
    8. Comment
    9. CustomEvent
    10. DOMError
    11. DOMException
    12. DOMImplementation
    13. DOMParser
    14. DOMPoint
    15. DOMPointReadOnly
    16. DOMRect
    17. DOMTimeStamp
    18. DOMTokenList
    19. Document
    20. DocumentFragment
    21. DocumentType
    22. Element
    23. Event
    24. EventTarget
    25. HTMLCollection
    26. MutationObserver
    27. NamedNodeMap
    28. Node
    29. NodeFilter
    30. NodeIterator
    31. NodeList
    32. ProcessingInstruction
    33. Range
    34. StaticRange
    35. Text
    36. TextDecoder
    37. TextEncoder
    38. TimeRanges
    39. TreeWalker
    40. XMLDocument
  • Web Technologies
  • Learn Web Development
  • About MDN
  • Feedback
  • About
  • MDN Web Docs Store
  • Contact Us
  • Firefox

MDN

  • MDN on Twitter
  • MDN on Github

Mozilla

  • Mozilla on Twitter
  • Mozilla on Instagram

© 2005-2022 Mozilla and individual contributors. Content is available under these licenses.

  • Terms
  • Privacy
  • Cookies