This article describes the JS implementation of click Pictures to copy the picture address to the Pasteboard method. Share to everyone for your reference. Specifically as follows:
Copy Code code as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta name= "Robots" content= "all"/>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title> click picture to copy the image address directly to the Clipboard </title>
<style type= "Text/css" >
#www_jb51_net_hidden {
Position:absolute;
Visibility:hidden;
}
IMG {
Cursor:pointer;
}
</style>
<body>
Click on the image below to get the address directly.
<div id= "Jb51_net" >
<br/>
</div>
<span id= "Www_jb51_net_hidden" ></span>
</body>
<script type= "Text/javascript" >
<!--
$id =function (ID) {
return document.getElementById (ID);
}
var objs = $id ("Jb51_net"). getElementsByTagName ("img");
for (Var i=0;i<objs.length;i++) {
Objs[i].onclick=function () {
$id ("Www_jb51_net_hidden"). Innerhtml=this.src;
var my_range =document.body.createtextrange ();
My_range.movetoelementtext ($id ("Www_jb51_net_hidden"));
My_range.execcommand ("copy");
Alert ("The picture address has been copied to the Clipboard");
return false;
}
}
-->
</script>
The
wants this article to help you with your JavaScript programming.