I’d like to create a link that when it is clicked it will open up a some sort of dialog with some text a user can copy.
I was going to use jquery ui dialog for this but I’m wondering if there is something else I should consider?
Ideally I’d like to have that text highlighted so it is ready to copy. Don’t think I can do this with jquery dialog?
Any guidance would be appreciated.
Try this :
HTML :
JavaScript:
This opens a dialog and then selects all of the text within the textarea. Because the
focusfunction is used you can Ctrl+C straight off as the text is already in focus and selected.Working demo : http://jsfiddle.net/eZbXD/