JS implements the method of obtaining the clipboard content, and js implements the method of obtaining the clipboard content.
This document describes how to obtain the clipboard content in JavaScript. We will share this with you for your reference. The details are as follows:
Here we introduce the code for JS to get the clipboard content:
<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> <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> 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 );