I have a select control with pre defined values and I want my users to be able to copy the selected item\'s text with CTRL + C
I don\'t want them to be able to chang
As far as I know, it is not possible to mark the text of a option element. Copy text into clipboard without flash is impossible, too.
This solution is not the best, but it's the simplest:
-
$('body').on('change', 'select', function() {
$('input').val($(this).find(":selected").text()).select();
})
http://jsfiddle.net/5C3Q9/2/
Just copy the text into a input field, so the user can select and copy it.