$("button").click(function(){
var value = "我是复制的内容";
if(!!value){
var transfer = $("<input type='text' id='copy_text'>");
$(this).parents('#form-container').append(transfer);
transfer.val(value)
transfer.focus();
transfer.select();
document.execCommand('Copy', false, null);
$('#copy_text').remove();
}
else{
swal('Can not copy blank strings');
return '';
}
});
js实现chrome浏览器copy复制功能
猜你喜欢
转载自blog.csdn.net/bbbzhuzhu/article/details/89377094
今日推荐
周排行