Set cursor at a length of 14 onfocus of a textbox

前端 未结 3 622
一整个雨季
一整个雨季 2020-11-27 23:16

Hai Guys, I want to set cursor at a position of length 14 on a textbox which will not have a value.. Iknow initially cursor will be at 0 i want it to be at 14

3条回答
  •  醉话见心
    2020-11-27 23:44

    $("#textbox").selectionStart=14 might works for Firefox, Opera, Chrome, but not sure for IE

    PS: There should be length 14 > characters already in textbox to work properly.

提交回复
热议问题