The HTMLInputElement.setSelectionRange() method sets the start and end positions of the current text selection in an <input> element.