* @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)
| 6721 | * -@offsets Object of same form that is returned from get* |
| 6722 | */ |
| 6723 | function setSelection(input, offsets) { |
| 6724 | var start = offsets.start, |
| 6725 | end = offsets.end; |
| 6726 | |
| 6727 | if (end === undefined) { |
| 6728 | end = start; |
| 6729 | } |
| 6730 | |
| 6731 | if ('selectionStart' in input) { |
| 6732 | input.selectionStart = start; |
| 6733 | input.selectionEnd = Math.min(end, input.value.length); |
| 6734 | } else { |
| 6735 | setOffsets(input, offsets); |
| 6736 | } |
| 6737 | } |
| 6738 | |
| 6739 | var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11; |
| 6740 |
no test coverage detected