Select Text & highlight selection or get selection value (React)

后端 未结 6 1294
长发绾君心
长发绾君心 2021-02-02 02:33

I have a React application which displays some spans:

Hello my name  is &l         


        
6条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-02 03:10

    I think that it's the right way...

     document.onmouseup = () => {
       console.log(window.getSelection().toString());
     };
    

提交回复
热议问题