Prevent user from copying text on mobile browsers

前端 未结 11 2112
陌清茗
陌清茗 2021-02-20 01:57

I\'m trying to develop a typing speed competition using JavaScript. People should write all the words they see from a div to a textarea.

To prevent cheating (like copyin

11条回答
  •  佛祖请我去吃肉
    2021-02-20 02:09

    One crazy way of doing this is, laying out another absolutely positioned element on top of this. But this will disallow clicking of links too! May be you can do it with position: relative and a higher z-index.

    .content {position: relative;}
    .content .mask {position: absolute; z-index: 1; width: 100%; height: 100%;}
    .content a {position: relative; z-index: 3;}

    Pages that you view in incognito tabs won’t stick around in your browser’s history, cookie store or search history after you’ve closed all of your incognito tabs. Any files that you download or bookmarks that you create will be kept. Learn more about incognito browsing

    Try using the touch or longpress events.

    
    
    
      
    
    
      
    
    
    

    Source

提交回复
热议问题