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

来源:互联网 发布:安知玉如意书包网 编辑:程序博客网 时间:2024/05/17 01:49

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

原创粉丝点击