* @setSelection: Sets the selection bounds of a textarea or input and focuses * the input. * -@input Set selection bounds of this input or textarea * -@offsets Object of same form that is returned from get*
(input, offsets)
| 5816 | * -@offsets Object of same form that is returned from get* |
| 5817 | */ |
| 5818 | function setSelection(input, offsets) { |
| 5819 | var start = offsets.start, |
| 5820 | end = offsets.end; |
| 5821 | |
| 5822 | if (end === undefined) { |
| 5823 | end = start; |
| 5824 | } |
| 5825 | |
| 5826 | if ('selectionStart' in input) { |
| 5827 | input.selectionStart = start; |
| 5828 | input.selectionEnd = Math.min(end, input.value.length); |
| 5829 | } else { |
| 5830 | setOffsets(input, offsets); |
| 5831 | } |
| 5832 | } |
| 5833 | |
| 5834 | var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11; |
| 5835 |
no test coverage detected