The Selection.modify() method applies a change to the current selection or cursor position, using simple textual commands.
Selection.modify()
MDN Reference