- bBool=false
- var copiedtext=""
- var tempstore=""
- function initiatecopy() {
- bBool=true;
- }
- function copyit() {
- if (bBool) {
- tempstore=copiedtext
- document.execCommand("Copy")
- copiedtext=window.clipboardData.getData("Text");
- if (tempstore!=copiedtext) {
- alert(copiedtext);
- }
- bBool=false;
- }
- }
- document.onselectionchange = initiatecopy
- document.onmouseup = copyit
Raw Paste