Skip to content Skip to sidebar Skip to footer

Cannot Get Document.execcommand To Work Properly With Copying Text

Here is my code: function createTextArea() { var t = document.createElement('textArea'); textArea = document.body.appendChild(t); return textArea; } function copy(str

Solution 1:

You have a typo according to documentatin. From Rich-Text Editing in Mozilla about executing commands

copy Copies the current selection to the clipboard. Clipboard capability must be enabled in the user.js preference file.

And see those two posts: How do you configure Firefox to allow Javascript to intercept a value pasted from the clipboard? and Copy to Clipboard for all Browsers using javascript

So, it seems very questionable if you can do that.

Post a Comment for "Cannot Get Document.execcommand To Work Properly With Copying Text"