[英]How to click on an element and use javascripts “copy” event to add to the clipboard
Javascript finally has the "copy" event and we no longer have to use flash! JavaScript终于有了“复制”事件,我们不再需要使用flash! (well, we still should use flash as a fallback). (嗯,我们仍然应该使用flash作为后备)。
http://dev.w3.org/2006/webapi/clipops/#x3.1.1-copy-event http://dev.w3.org/2006/webapi/clipops/#x3.1.1-copy-event
I'm trying to figure out how to: Click on an anchor tag (Copy) and it copies the (text input src /or innerHTML) to the clipboard. 我试图弄清楚如何:单击定位标记(复制),然后将(文本输入src /或innerHTML)复制到剪贴板。 Here's a fiddle of the HTML/CSS http://jsfiddle.net/LkUhM/ 这是HTML / CSS的小提琴http://jsfiddle.net/LkUhM/
Can anyone guide me? 谁能指导我?
:::::HTML::::: ::::: HTML :::::
<div>
<ul>
<li><input type="text" class="input" value="This is the next that will be copied!" /><a href="#" id="copy" class="copy">Copy!</a></li>
<li><input type="text" class="input" value="This is the next that will be copied!" /><a href="#" id="copy" class="copy">Copy!</a></li>
<li><input type="text" class="input" value="This is the next that will be copied!" /><a href="#" id="copy" class="copy">Copy!</a></li>
<li><input type="text" class="input" value="This is the next that will be copied!" /><a href="#" id="copy" class="copy">Copy!</a></li>
</ul>
<textarea></textarea>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.