Click here to Skip to main content
15,891,529 members

Comments by poojakumawat1 (Top 1 by date)

poojakumawat1 6-Feb-18 2:21am View    
there is only one page in which i have to clear clipboard when the same string gets pasted.
For e.g i have copied a string and i m trying to paste that string in one textbox and it should get pasted. then i try to paste that string in another textbox ,it should not be pasted.but if i again copy that string ,it should be pasted in textbox.
So all i want to clear my clipboard after pasting value
document.addEventListener("paste", function (e) {
e.target.value = e.clipboardData.getData('Text');

//Clear logic of clipboard in javascript
});
i could try this: e.clipboardData.setData('Text','');,clipboardData.cleardata();
but this is not supporting in chrome.
HELP