Example: JS to achieve the mouse click to copy the title and address to the clip version

Source: Internet
Author: User
Tags copy version window
js| Mouse

In many websites you may see oneself like an article, want to send it quickly to netizens, the realization method is to use the mouse to operate! But this operation is too cumbersome! Here to tell you a small example, the direct click button can copy the title and address.

<input title= "Click the copy title and address to the Clipboard, and paste directly on the popo/msn." Type=button value= "click to copy this site, to popo/qq/msn friend sharing" Name= ">
<script language= ' JavaScript ' >
function CopyToClipboard () {
var clipboardcontent= ';
Clipboardcontent+=document.title;
Clipboardcontent+=window.location;
Window.clipboardData.setData ("Text", clipboardcontent);
Alert ("You have copied the link and title, please paste it into the popo/msn and so on to send friends!");
}
</script>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.