• Skip to main content
  • Skip to search
  • Skip to select language
MDN Web Docs
  • References
    • Overview / Web Technology

      Web technology reference for developers

    • HTML

      Structure of content on the web

    • CSS

      Code used to describe document style

    • JavaScript

      General-purpose scripting language

    • HTTP

      Protocol for transmitting web resources

    • Web APIs

      Interfaces for building web applications

    • Web Extensions

      Developing extensions for web browsers

    • Accessibility

      Build web projects usable for all

    • Web Technology

      Web technology reference for developers

  • Learn
    • Overview / MDN Learning Area

      Learn web development

    • MDN Learning Area

      Learn web development

    • HTML

      Learn to structure web content with HTML

    • CSS

      Learn to style content using CSS

    • JavaScript

      Learn to run scripts in the browser

    • Accessibility

      Learn to make the web accessible to all

  • Plus
    • Overview

      A customized MDN experience

    • AI Help

      Get real-time assistance and support

    • Updates

      All browser compatibility updates at a glance

    • Documentation

      Learn how to use MDN Plus

    • FAQ

      Frequently asked questions about MDN Plus

  • Curriculum New
  • Blog
    • Playground

      Write, test and share your code

    • HTTP Observatory

      Scan a website for free

    • AI Help

      Get real-time assistance and support

  • Log in
  • Sign up for free
  1. Tecnología para desarrolladores web
  2. Referencia de la API Web
  3. Selection
  4. removeAllRanges
    • English (US)
    • Deutsch
    • 中文 (简体)

Esta página ha sido traducida del inglés por la comunidad. Aprende más y únete a la comunidad de MDN Web Docs.

  1. Modelo de Objetos del Documento (DOM)
  2. Selection
  3. Propiedades de instancia
    1. anchorNode
    2. anchorOffset
    3. direction
    4. focusNode
    5. focusOffset
    6. isCollapsed
    7. rangeCount
    8. type
  4. Métodos de instancia
    1. addRange()
    2. collapse()
    3. collapseToEnd()
    4. collapseToStart()
    5. containsNode()
    6. deleteFromDocument()
    7. empty()
    8. extend()
    9. getComposedRanges() Experimental
    10. getRangeAt()
    11. modify()
    12. removeAllRanges()
    13. removeRange()
    14. selectAllChildren()
    15. setBaseAndExtent()
    16. setPosition()
    17. toString()
  5. Páginas relacionadas a DOM
    1. AbortController
    2. AbortSignal
    3. AbstractRange
    4. Attr
    5. CDATASection
    6. CharacterData
    7. Comment
    8. CustomEvent
    9. DOMError Obsoleto
    10. DOMException
    11. DOMImplementation
    12. DOMParser
    13. DOMPoint
    14. DOMPointReadOnly
    15. DOMRect
    16. DOMTokenList
    17. Document
    18. DocumentFragment
    19. DocumentType
    20. Element
    21. Event
    22. EventTarget
    23. HTMLCollection
    24. MutationObserver
    25. MutationRecord
    26. NamedNodeMap
    27. Node
    28. NodeIterator
    29. NodeList
    30. ProcessingInstruction
    31. Range
    32. StaticRange
    33. Text
    34. TextDecoder
    35. TextEncoder
    36. TimeRanges
    37. TreeWalker
    38. XMLDocument

removeAllRanges

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

  • Learn more
  • See full compatibility
  • Report feedback

Resumen

Quita todos los rangos de la selección, dejando las propiedades anchorNode y focusNode con un valor null (nulo) y dejando nada seleccionado.

Sintaxis

sel.removeAllRanges();

Parámetros

Ninguno.

Help improve MDN

Learn how to contribute.

This page was last modified on 17 dic 2024 by MDN contributors.

View this page on GitHub • Report a problem with this content
MDN logo

Your blueprint for a better internet.

  • MDN on Bluesky
  • MDN on Mastodon
  • MDN on X (formerly Twitter)
  • MDN on GitHub
  • MDN Blog RSS Feed

MDN

  • About
  • Blog
  • Careers
  • Advertise with us

Support

  • Product help
  • Report an issue

Our communities

  • MDN Community
  • MDN Forum
  • MDN Chat

Developers

  • Web Technologies
  • Learn Web Development
  • MDN Plus
  • Hacks Blog
  • Website Privacy Notice
  • Cookies
  • Legal
  • Community Participation Guidelines

Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2025 by individual mozilla.org contributors. Content available under a Creative Commons license.

OSZAR »