-3

Consider an editable Textarea. I have selected only 2 lines out of 5 lines & copied the some text using my button and I want to paste the text when paste button is clicked.

I tried using document.execCommand('paste'). Which is not working due to security issues in browsers.

How to implement paste using a button in javascript/Jquery or any front end library. Copy is working fine but paste using a button is not at all working.

Many cameup with solutions explaining pasting of all the content in textarea Remember that I need the text which got copied not the entire textarea

Joseph Nannepaga
  • 175
  • 1
  • 3
  • 14

1 Answers1

0

A quick search and I stumbled upon this post You could try using a button that runs window.clipboardData.getData('Text') and use the output to put in your textArea.

Bruno Robert
  • 302
  • 2
  • 8