开发者

Javascript, avoid cursor moving at textbox end

I have a js funciton executed at one textbox OnKeyUp event.

The textbox has a valu开发者_如何学Ce by default.

If I place my cursor in the middle of the string and I add a char, the cursor moves at the end of the string.

I know that this is because the executed function recalculate and set the textbox value.

Is there a way to avoid the cursor moving at the end of the string?

Thanks


Changing the value of the text in the textbox will always move the cursor to the end

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜