Selection class

A Selection object represents the range of text selected by the user or the current position of the caret. To obtain a Selection object for examination or modification, call Window.getSelection().

MDN Reference

Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

Selection()
factory

Properties

addRange ↔ void Function(Range)

Available on Selection, provided by the Selection$Typings extension

getter/setter pair
anchorNode Node?

Available on Selection, provided by the Selection$Typings extension

MDN Reference
no setter
anchorOffset num

Available on Selection, provided by the Selection$Typings extension

MDN Reference
no setter
collapse ↔ void Function([Node?, num?])

Available on Selection, provided by the Selection$Typings extension

getter/setter pair
collapseToEnd ↔ void Function()

Available on Selection, provided by the Selection$Typings extension

getter/setter pair
collapseToStart ↔ void Function()

Available on Selection, provided by the Selection$Typings extension

getter/setter pair
containsNode bool Function(Node, [bool?])

Available on Selection, provided by the Selection$Typings extension

getter/setter pair
deleteFromDocument ↔ void Function()

Available on Selection, provided by the Selection$Typings extension

getter/setter pair
empty ↔ void Function()

Available on Selection, provided by the Selection$Typings extension

getter/setter pair
extend ↔ void Function(Node, [num?])

Available on Selection, provided by the Selection$Typings extension

getter/setter pair
focusNode Node?

Available on Selection, provided by the Selection$Typings extension

MDN Reference
no setter
focusOffset num

Available on Selection, provided by the Selection$Typings extension

MDN Reference
no setter
getRangeAt Range Function(num)

Available on Selection, provided by the Selection$Typings extension

getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isCollapsed bool

Available on Selection, provided by the Selection$Typings extension

MDN Reference
no setter
modify ↔ void Function([String?, String?, String?])

Available on Selection, provided by the Selection$Typings extension

getter/setter pair
rangeCount num

Available on Selection, provided by the Selection$Typings extension

MDN Reference
no setter
removeAllRanges ↔ void Function()

Available on Selection, provided by the Selection$Typings extension

getter/setter pair
removeRange ↔ void Function(Range)

Available on Selection, provided by the Selection$Typings extension

getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectAllChildren ↔ void Function(Node)

Available on Selection, provided by the Selection$Typings extension

getter/setter pair
setBaseAndExtent ↔ void Function(Node, num, Node, num)

Available on Selection, provided by the Selection$Typings extension

getter/setter pair
setPosition ↔ void Function([Node?, num?])

Available on Selection, provided by the Selection$Typings extension

getter/setter pair
toString$ String Function()

Available on Selection, provided by the Selection$Typings extension

getter/setter pair
type String

Available on Selection, provided by the Selection$Typings extension

MDN Reference
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited