I pretty much agree with leatherback.
You could also just add a event handler to elements of the page which have any text that you might want to enable being copied to the box and then during that method, determine where the click was, if it was in the middle of a "word", the extent of the "word" and then add that word string to the box.
Another way to do it, require one to highlight the text one wants first and then on the click event handler simply finds what is highlighted, verify that it is indeed text and then add it to the box.
The latter is the way I would go.