direction

The direction read-only property of the Selection interface is a string that provides the direction of the current selection.

MDN Reference