On first run this code copies the string to the clipboard. On the clipboard should be “mystring123aaajj”.
The output on the console is truncated, it shows the partial code with the arrow for more of the code. But the output of the line ‘console.log(“result”,result)’ seems to be missing.
Now, if I try this code again (cntrl + enter in multiline mode) I get the partial code and arrow, and ‘result false’ and a warning error - ‘document.execCommand(‘cut’/‘copy’) was denied because it was not called from inside a short running user-generated event handler.’
Here is the code:
//works once in the console
Works on first run but fails on second run?
This behaviour is different in Chrome.