ZeroClipboard is the best cross-browser solution I've found:
<p id="copy" data-clipboard-text="Copy Me!">Click to copy</p>
<script src="ZeroClipboard.js"></script>
<script>
var clip = new
ZeroClipboard(document.getElementById('copy'));
</script>
If you need non-flash support for iOS you just add a fall-back:
clip.on('noflash', function(client, args) {
$("#copy").click(function() {
var txt = $(this).attr('data-clipboard-text');
prompt("Copy link, then click OK.", txt);
});
});
stackoverflow看到这么一个回答,ios上的不兼容使用了一个很机智的trick。。。:
原答案地址
同求 试了很多 移动端总不兼容