M
Mahsha
<html>
<head>
<title>Clipboard cut, copy and paste with JavaScript</title>
<script type="text/javascript">
function CutToClipboard()
{
CutTxt = document.selection.createRange();
CutTxt.execCommand("Cut");
}
function CopyToClipboard()
{
CopiedTxt = document.selection.createRange();
CopiedTxt.execCommand("Copy");
}
function PasteFromClipboard()
{
document.Form1.txtArea.focus();
PastedText = document.Form1.txtArea.createTextRange();
PastedText.execCommand("Paste");
}
</script>
</head>
<body>
<form name="Form1">
<h1>Clipboard cut, copy and paste with JavaScript</h1>
Select this text, copy it using the copy button, and paste it
below.<br /><br />
<textarea id="txtArea" cols="60" rows="5"></textarea>
<br />
<input type="button" onClick="CutToClipboard()" value="Cut to
clipboard" />
<input type="button" onClick="CopyToClipboard()" value="Copy to
clipboard" />
<input type="button" onClick="PasteFromClipboard()" value="Paste
from clipboard" />
</form>
</body>
</html>
<head>
<title>Clipboard cut, copy and paste with JavaScript</title>
<script type="text/javascript">
function CutToClipboard()
{
CutTxt = document.selection.createRange();
CutTxt.execCommand("Cut");
}
function CopyToClipboard()
{
CopiedTxt = document.selection.createRange();
CopiedTxt.execCommand("Copy");
}
function PasteFromClipboard()
{
document.Form1.txtArea.focus();
PastedText = document.Form1.txtArea.createTextRange();
PastedText.execCommand("Paste");
}
</script>
</head>
<body>
<form name="Form1">
<h1>Clipboard cut, copy and paste with JavaScript</h1>
Select this text, copy it using the copy button, and paste it
below.<br /><br />
<textarea id="txtArea" cols="60" rows="5"></textarea>
<br />
<input type="button" onClick="CutToClipboard()" value="Cut to
clipboard" />
<input type="button" onClick="CopyToClipboard()" value="Copy to
clipboard" />
<input type="button" onClick="PasteFromClipboard()" value="Paste
from clipboard" />
</form>
</body>
</html>