src/aria/utils/Caret.js
function (element, start, end) {
            if ("selectionStart" in element) {
                element.selectionStart = start;
                element.selectionEnd = end;
            } else {
                var document = Aria.$window.document;
                if (document.selection) {
                    var range = element.createTextRange();
                    range.moveStart('character', start);
                    range.moveEnd('character', -element.value.length + end);
                    range.select();
                }
            }
        }
function (element, start, end) {
            if ("selectionStart" in element) {
                element.selectionStart = start;
                element.selectionEnd = end;
            } else {
                var document = Aria.$window.document;
                if (document.selection) {
                    var range = element.createTextRange();
                    range.moveStart('character', start);
                    range.moveEnd('character', -element.value.length + end);
                    range.select();
                }
            }
        }
function ( element , start , end ) { if ( "selectionStart" in element ) { element . selectionStart = start ; element . selectionEnd = end ; } else { var document = Aria . $window . document ; if ( document . selection ) { var range = element . createTextRange ( ) ; range . moveStart ( 'character' , start ) ; range . moveEnd ( 'character' , - element . value . length + end ) ; range . select ( ) ; } } }
Set the caret position of the HTML element
@param {HTMLElement} element The html element
@param {Integer} start The starting caret position
@param {Integer} end The ending caret position
Set the caret position of the HTML element