I\'m looking for a way to set a selection in a textarea in Internet Explorer. In other browsers, this works just fine:
textarea.selectionStart = sta
Try with
function select(e, start, end){
e.focus();
if(e.setSelectionRange)
e.setSelectionRange(start, end);
else if(e.createTextRange) {
e = e.createTextRange();
e.collapse(true);
e.moveEnd('character', end);
e.moveStart('character', start);
e.select();
}
}
select(document.getElementById('textarea_id'), 5, 10);