Forum Moderators: open
Does anyone know if it is possible have an icon that copies a certain text string into the systems clipboard.
i.e.: I have a text-string "this is the text" that the user doesn't need to see that I want to copy to the system clipboard if he/she clicks a corresponding icon (possibly image of scissors). It should then be able to paste the contents with Ctrl+V into for instance an e-mail.
Thanks for any help...
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Nouvelle page 1</title><script type="text/javascript">
function sendToClipboard(s)
{
if( window.clipboardData && clipboardData.setData )
{
clipboardData.setData("Text", s);
}
else
{
alert("Internet Explorer required");
}
}
</script>
</head>
<body>
<div ID='textespan'>Ici le texte de votre choix!</div><BR>
<A HREF=# onclick="sendToClipboard(document.getElementById('textespan').innerHTML)">Copiez ce texte</A>
</body>
</html>