Russ Cam is missing an edge case -- you can drag and drop text into and within input fields by highlighting and dragging, which his code does not account for.
Below code that covers this case:
$(function() {
var areaText = $('#area').val();
$('#text').bind('keyup keypress drop', dropfunction() {
$('#area')[0].value = areaText + $(this)[0].value;
});
});
That said, there is still another edge case, which is deleting and manipulating via context menu. As of right now I can't see a way to detect the selection of context menu interaction... You could disable it if that is important using the following code
$('#text').bind('contextmenu', function() {
return false
});