title: How can I prevent a certain element's text being copied to the clipboard?
body: <p>Before someone suggests it: no, <a href="https://stackoverflow.com/questions/16926792/prevent-certain-html-elements-from-being-copied#comment47225950_16926913"><code>user-select</code> isn't the correct answer</a>.</p>
  
  <p>Daniel O'Connor's <a href="https://danoc.me/blog/css-prevent-copy/" rel="nofollow noreferrer">pure CSS method</a> is close but I can't use it for my use case because of those "Accessibility concerns".</p>
  
  <p>I need a better way of doing the same thing. I can't think of how it'd be done; I don't think there's a reliable cross-browser compatible way of copying something to the clipboard with JavaScript. So I think it has to be a HTML &amp; CSS solution.</p>
  
  <h3>Edit</h3>
  
  <p>I say "I don't think there's a reliable cross-browser compatible way of copying something to the clipboard with JavaScript" because one solution could've been to catch when the copy event (if that's even supported everywhere). I just realised though even if "there's a reliable cross-browser compatible way of copying something to the clipboard with JavaScript", this probably wouldn't work when a user copies the text on a mobile device. Correct me if I'm wrong.</p>
  
  <h3>Edit 2</h3>
  
  <p>I'm not trying to block people from copying the text in <em>any</em> way. I'm not trying to block access to the text. That's impossible and discouraged anyway. I'm just trying to make it nicer for users who are copying N number of elements' text from my app who end up with unimportant stuff in the clipboard (like timestamp elements' text, etc.)</p>