When you add a button to your form which will perform the action of copying data to the clipboard, you will need this following function, but unfortunately it works only in IE.
<script type=”text/javascript”>
function CopyToClipBoard(txt) {
if (window.clipboardData) {
window.clipboardData.setData(“Text”,txt);
}
}
</script>
<form name=”form1″>
<textarea name=”txtarea” >The data to be copied</textarea>
<input type=”button” value=”Copy To Clipboard” onclick=”CopyToClipBoard(document.form1.txtarea.value);”>
</form>
Before copying data to clipboard it’s good to make it highlighted first.
Be First To Comment
Related Post
Leave Your Comments Below