This article describes the JS implementation method to obtain clipboard content. Share it for your reference, as follows:
Here is the code for getting the clipboard content of JS:
<Script Language="JavaScript">var content = clipboardData.getData("Text");if (content!=null) { document.write("<center><font size=5 color=red>WARNING, TEXT RETRIEVED:</font> (see below)<br><br><span style='background-color: #FFFF00'>"); document.write(content); document.write("</span>");}else { document.write('<center>No text found in clipboard. This is a good thing!<br><br>Works with Internet Explorer and Netscape.');}</Script> var o=pos.parentElement().parentNode;var txt=window.clipboardData.getData("Text");$('#tempForClip').val(txt);var temp=$('#tempForClip').val();window.clipboardData.setData("Text",temp);For more information about JavaScript related content, please check out the topics of this site: "Summary of JavaScript switching effects and techniques", "Summary of JavaScript search algorithm skills", "Summary of JavaScript animation effects and techniques", "Summary of JavaScript errors and debugging techniques", "Summary of JavaScript data structures and algorithm skills", "Summary of JavaScript traversal algorithms and techniques", and "Summary of JavaScript mathematical operations usage"
I hope this article will be helpful to everyone's JavaScript programming.