// promise is returned for outcome;
// might require browser permissions;
// prefer this API as "execCommand" is deprecated
navigator.clipboard.writeText("some text").then(function() {
/* clipboard successfully set */
}, function() {
/* clipboard write failed */
});