* @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)
| 10747 | */ |
| 10748 | |
| 10749 | function setSelection(input, offsets) { |
| 10750 | var start = offsets.start, |
| 10751 | end = offsets.end; |
| 10752 | |
| 10753 | if (end === undefined) { |
| 10754 | end = start; |
| 10755 | } |
| 10756 | |
| 10757 | if ('selectionStart' in input) { |
| 10758 | input.selectionStart = start; |
| 10759 | input.selectionEnd = Math.min(end, input.value.length); |
| 10760 | } else { |
| 10761 | setOffsets(input, offsets); |
| 10762 | } |
| 10763 | } |
| 10764 | |
| 10765 | var validateDOMNesting = function () {}; |
| 10766 |
no test coverage detected