This came up while working on #5791.

It would be very useful for both core as well as contrib to be able to easily add click-to-copy buttons to things like text fields, text areas, and perhaps also error messages and watchdog entries.

Although it is generally considered relatively easy for people to be able to copy/paste, that might not always be the case. Quoting from https://github.com/backdrop/backdrop-issues/issues/5791#issuecomment-157...

Click > copy > paste is good enough I think.

...I agree ...however, it's more like: click > drag-select > may need to scroll depending on screen real estate > copy > paste ...or: right-click > select all (assuming that a) the browser supports it, and b) the person is using a pointing device that would allow them to right-click or that they know that hold-to-select is a thing) > copy > paste ...or good-old CTRL+A > CTRL+C > CTRL+P ...but all that assumes certain tech knowledge/affinity. As a person that is all about UX, and less clicks, less scrolling, less fiddling, having links to copy to clipboard or to download as .txt in a single click seem very appealing.

GitHub Issue #: 
6135