I heard that you can’t copy text (in the browser) without using something like Flash; so, is there a way to select text by using an anchor and JavaScript or jQuery.
<p>Text to be copied</p>
<a>Copy Text Above</a>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Given the following example html:
you can select the text within the textarea with the following jQuery:
Now that the text “This is some sample text that I want to be select to copy to the clipboard” is selected, you can simply hit Ctrl+C and the text is copied to the clipboard.