1. 程式人生 > >input框獲取焦點時讓光標聚焦到行末

input框獲取焦點時讓光標聚焦到行末

class 光標 ado als inpu don mod modify readonly

function modifyEntName(){
$("#enterpriseName").attr("readonly",false).focus();
//使光標顯示在行末
var result=$("#enterpriseName").val();
$("#enterpriseName").val("")
$("#enterpriseName").val(result);
}

input框獲取焦點時讓光標聚焦到行末