如果只是兼容IE可用如下方法實現: function copyToClipboard() { var format = "text"; var value; var isIE = false; if(!+[