开发者

Retain user selected text on blur/focus

How can I retain the user's text selection when calling $(inputElement).focus() on some text input element, inputElement, so that they can still use Ctrl+C after inputting some text top their initial selection?

I have considered intercepting the $(document).blur(...) event and preventing propagation to keep the selected text, but I'm not sure if it will work across all major browsers, if at 开发者_StackOverflowall.


if i didn't misunderstood...

you can use window.storage or document.cookie(in case window.storage is un available)... when the user input text in the field you can store its value(onBlur) against an id and on ctrl+C retrieve the value and put it else where (in case of ctrl+z)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜