文本域取得焦点置到内容的最后

文本域获得焦点置到内容的最后//x为文本域对象function f_setCursorPos(x){ var txtRange x.createTextR

文本域获得焦点置到内容的最后

//x为文本域对象
function f_setCursorPos(x){
var txtRange = x.createTextRange();
txtRange.moveStart("character",x.value.length);
txtRange.moveEnd("character",0);
txtRange.select();
}