Clipboard.js实现复制内容到剪切板
<script type="text/javascript">
var clipboard1 = new Clipboard('.bt01');
clipboard1.on('success', function (e) {
alert("Copy Url Success!");
e.clearSelection();
});
</script>
<div class="mt5"><img src="../../Images/pdf1.png" class="inline-any"><input type="text" id="hid01" width="100px" value="@ViewBag.Url1" /> <input type="button" value="Copy url" class="btn1 inline-any bt01" data-clipboard-action="copy" data-clipboard-target="#hid01" /></div>
要先添加Clipboard.js的引用
每天学一点,每天积累一天,进步就不止一点点!PS:好记性不如烂笔头,学会总结,学会思考~~~
----要飞翔,必须靠自己!