* @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)
| 6834 | * -@offsets Object of same form that is returned from get* |
| 6835 | */ |
| 6836 | function setSelection(input, offsets) { |
| 6837 | var start = offsets.start, |
| 6838 | end = offsets.end; |
| 6839 | |
| 6840 | if (end === undefined) { |
| 6841 | end = start; |
| 6842 | } |
| 6843 | |
| 6844 | if ('selectionStart' in input) { |
| 6845 | input.selectionStart = start; |
| 6846 | input.selectionEnd = Math.min(end, input.value.length); |
| 6847 | } else { |
| 6848 | setOffsets(input, offsets); |
| 6849 | } |
| 6850 | } |
| 6851 | |
| 6852 | var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11; |
| 6853 |
no test coverage detected