Last active
March 13, 2019 13:43
-
-
Save grafst/804353a539e7daa2c6c4e148a370ace1 to your computer and use it in GitHub Desktop.
clipboard access in internet explorer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Acces Clipboard in Internetexplorer--> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
function CopyToClipboard(elementId){ | |
var input = document.getElementById(elementId); | |
window.clipboardData.setData ("Text", input.value); | |
} | |
function GetClipboardContent(){ | |
return (window.clipboardData.getData("Text")); | |
} | |
function ClearClipboard(){ | |
window.clipboardData.clearData("Text"); | |
} | |
</script> | |
</head> | |
<body> | |
<input id="toClipboard" value="text to clipboard"/> | |
<button onclick='CopyToClipboard("toClipboard")'>Copy text to clipboard</button> | |
<br/><br/> | |
<button onclick='alert(GetClipboardContent())'>Show text data in clipboard</button> | |
<button onclick='ClearClipboard();'>Clear text data from clipboard</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment