IE js code:
The code copy is as follows:
<script type="text/javascript">
function copyUrl2()
{
var Url2=document.getElementById("biao1");
Url2.select(); // Select an object
document.execCommand("Copy"); // Execute the browser copy command
alert("Copy, can be pasted.");
}
</script>
<textarea cols="20" rows="10" id="biao1">User-defined code area</textarea>
<input type="button" onClick="copyUrl2()" value="click to copy code" />
chrome JS code:
The code copy is as follows:
<script src="http://www.weicaiyun.com/assets/js/copy/ZeroClipboard.js"></script>
<script type="text/javascript">
var clip = new ZeroClipboard.Client();
clip.setHandCursor( true );
clip.setText('Copy content');
clip.glue('button');
</script>
<input type="button" id="button" value="click to copy code" />