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 all.