1024programmer Java Code to control the clipboard through JS under IE_javascript skills

Code to control the clipboard through JS under IE_javascript skills

Javascript can use the window.clipboardData object to process clipboard content
Method setData(param1, param2) to save to the clipboard
param1: Data type text or URL, etc.
param2: Data content
From clipboard The method for reading data from the board is getdata(param1)
The method for clearing data is clearData(param1)
The following is an example demonstration


[Ctrl+A to select all Note: If you need to introduce external Js, you need to refresh to execute]


The following is another example to implement the function of selecting characters on the page and dragging them to the text area
Note that the window.event.dataTransfer object can also handle clipboard content, but it can only be used in drag-and-drop. In operation


[Ctrl+A to select all Note: If you need to introduce external Js, you need to refresh to execute]

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/722286

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索