to_clipboard = (text) -> textarea = document.getElementById "copy-workaround" textarea.value = text textarea.select() document.execCommand "copy", false, null
http://jsfiddle.net/vej6vbdt/