modify

fun modify(alter: String = definedExternally, direction: String = definedExternally, granularity: String = definedExternally)(source)

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

MDN Reference