jquery - Copy to clipboard using javascript programatically (testing) -
i've got script deals pasted text in text area. write tests it. first step copy text in clipboard
after reading lot topic ended this:
- add text area dom text want copy.
- add button dom runs
document.execcommant("copy")
on click. - remove text area & button dom.
please take account before marking question duplicate, other solutions i've seen involve user performing click action. asking how strictly programmatically.
document.execcommant("copy")
not work if it's not triggered user action due security reasons. in case, tests clicking on button, document.execcommant("copy")
won't work.
is there way of doing without using new libraries? (jquery fine).
i interested in solution works on chrome/firefox.
here can see fiddle step mentioned above: https://jsfiddle.net/7b40ma0q/
Comments
Post a Comment