function copyToClipboard (text) {
    if (w.clipboardData && w.clipboardData.setData) {
      // IE specific code path to prevent textarea being shown while dialog is visible.
      console.log('Copied:', clipboardData);
      return clipboardData.setData('Text', text);

    } else if (d.queryCommandSupported && d.queryCommandSupported('copy')) {
      var ta = d.createElement('textarea');
      ta.textContent = text;
      // Prevent scrolling to bottom of page in MS Edge.
      ta.style.position = 'fixed';
      d.body.appendChild(ta);
      ta.select();
      try {
        console.log('Copied: [', text, ']');
        // Security exception may be thrown by some browsers.
        return d.execCommand('copy');
      } catch (ex) {
        console.warn('Copy to clipboard failed:', ex);
        return false;
      } finally {
        d.body.removeChild(ta);
      }
    }
  }
// Copies a string to the clipboard.
Copies a string to the clipboard.
Copies a string to the clipboard .
function copyToClipboard (text) {
    if (w.clipboardData && w.clipboardData.setData) {
      console.log('Copied:', clipboardData);
      return clipboardData.setData('Text', text);
    } else if (d.queryCommandSupported && d.queryCommandSupported('copy')) {
      var ta = d.createElement('textarea');
      ta.textContent = text;
      ta.style.position = 'fixed';
      d.body.appendChild(ta);
      ta.select();
      try {
        console.log('Copied: [', text, ']');
        return d.execCommand('copy');
      } catch (ex) {
        console.warn('Copy to clipboard failed:', ex);
        return false;
      } finally {
        d.body.removeChild(ta);
      }
    }
  }
function copyToClipboard ( text ) { if ( w . clipboardData && w . clipboardData . setData ) { console . log ( 'Copied:' , clipboardData ) ; return clipboardData . setData ( 'Text' , text ) ; } else if ( d . queryCommandSupported && d . queryCommandSupported ( 'copy' ) ) { var ta = d . createElement ( 'textarea' ) ; ta . textContent = text ; ta . style . position = 'fixed' ; d . body . appendChild ( ta ) ; ta . select ( ) ; try { console . log ( 'Copied: [' , text , ']' ) ; return d . execCommand ( 'copy' ) ; } catch ( ex ) { console . warn ( 'Copy to clipboard failed:' , ex ) ; return false ; } finally { d . body . removeChild ( ta ) ; } } }
Copies a string to the clipboard.
Copies a string to the clipboard .
// IE specific code path to prevent textarea being shown while dialog is visible. // Prevent scrolling to bottom of page in MS Edge. // Security exception may be thrown by some browsers.