well this code might be useful for IE lovers and it also works for IE8
<head>
<script type="text/javascript">
var myClipboard = "";
function Copy () {
var src = document.getElementById ("src");
if (src.selectionStart === undefined) { // Internet Explorer
// you have done it in IE 7
}
else { // Firefox, Chrome, Opera and Safari
myClipboard = src.value.substring (src.selectionStart, src.selectionEnd);
}
}
function Paste () {
var dest = document.getElementById ("dest");
if (dest.selectionStart === undefined) { // Internet Explorer
// you have done it in IE 7
}
else {
# var newValue = dest.value.substring (0, dest.selectionStart);
newValue += myClipboard;
newValue += dest.value.substring (dest.selectionEnd);
dest.value = newValue;
}
}
</script>
</head>
<body>
<textarea id="src" cols="30">Select some text and use the copy and paste buttons to insert it into the second textarea.</textarea>
<br /><br />
<button onclick="Copy ()">Copy</button>
<button onclick="Paste ()">Paste</button>
<br /><br />
<textarea id="dest" cols="30"></textarea>
</body>.
Aug 17, 2010