Just to clarify, using user-select
is not the solution I'm looking for.
Although Daniel O'Connor has a CSS method that's close, it doesn't meet my needs due to "Accessibility concerns".
I'm searching for a more effective way to achieve the same goal. I can't come up with a method myself; it seems there might not be a reliable cross-browser compatible approach to copying content to the clipboard with JavaScript. Thus, an HTML & CSS solution seems necessary.
Edit
When I mentioned doubts about a reliable cross-browser way of copying content with JavaScript, one potential option was to trigger the copy event (if universally supported). However, I now realize this might not work on mobile devices when users attempt to copy text. Feel free to correct me if I am mistaken.
Edit 2
To clarify, I don't intend to prevent users from copying text in any manner. Blocking access to the content is neither feasible nor recommended. My aim is simply to enhance the experience for users who are copying multiple elements' text from my app and wish to avoid unnecessary content being included in their clipboard, such as timestamp elements' text, etc.