I have been trying to look for a solution to include a button on one of my WordPress posts which would copy a certain text into the clipboard when clicked. I however am no developer and haven’t found any good plugin for this (or I seem to be bad at searching).
The clipboard belongs to the user and for security reasons access to it needs to be initiated by the user, not script.
For example, depending on the browser used, if a user selects some text, that indicates that the user has “allowed” access to their clipboard. At that point, in addition to the browsers context menu JavaScript might then be able to display a type of “copy to clipboard” button.