jquery复制链接(复制Url链接)

$('点击对象').on('click',function(){
    copyUrl($(this));
  });
  function copyUrl (obj){
    if($('#urlText').length == 0){
      // 创建input
      obj.after('');
    }
    $('#urlText').select(); //选择对象
    document.execCommand("Copy"); //执行浏览器复制命令
  }

你可能感兴趣的:(jquery复制链接(复制Url链接))