Manipulate the caret's position in a text box or content-editable element