Set Focus After Last Character in Text Box

后端 未结 10 2417
梦谈多话
梦谈多话 2020-11-27 13:54

I have 3 text boxes for a phone number. As the user types, it automatically moves from one textbox to the next. When the user presses backspace, I can move focus to the pr

10条回答
  •  囚心锁ツ
    2020-11-27 14:49

    you can set pointer on last position of textbox as per following.

    temp=$("#txtName").val();
    $("#txtName").val('');
    $("#txtName").val(temp);
    $("#txtName").focus();
    

提交回复
热议问题