window.clipboardData.setData("Text", "this is a demo");
"Text"是数据的类型,还有一个是"URL"
返回值是boolean型
window.clipboardData.getData(sDataFormat)
sDataFormat是必须的参数,可为以下两个值
Text | Retrieves data formatted as text. |
URL | Retrieves data formatted as a URL. |
window.clipboardData.clearData( [sDataFormat])
sDataFormat为可选参数
Text | Removes the text format. |
URL | Removes the URL format. |
File | Removes the file format. |
HTML | Removes the HTML format. |
Image | Removes the image format. |