js 监听crtl c 输出选中内容

仅限ie意外浏览器

document.onkeydown=function(){  if(event.ctrlKey && event.keyCode==67){var text= window.getSelection?window.getSelection():document.selection.createRange().text;console.log(window.getSelection().toString());
  }}

posted @ 2021-03-01 15:58  绯颜旧雨  阅读(313)  评论(0编辑  收藏  举报