I cannot find a solution in stackoverflow. I have an input filed and a value. I want the value to be selected and highlighted, so the user can easily copy the text. How can I do it with jQuery?
<input value="copy this text easily" />
I cannot find a solution in stackoverflow. I have an input filed and a value. I want the value to be selected and highlighted, so the user can easily copy the text. How can I do it with jQuery?
<input value="copy this text easily" />
Try
$('input').focus()
You may need to change the selector though. I wrote a generic selector since there in only 1 input in the example.