The Selection.isCollapsed read-only property returns a Boolean which indicates whether or not there is currently any text selected; That is to say that the selection's start and end points are at the same position in the content.
The Selection.rangeCount read-only property returns the number of ranges in the selection.