Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

244
Views
dispatching ClipboardEvent on textarea element does not work

I wont to simulate paste event trough javascript as shown on snipped below

<!DOCTYPE html>
<html>
<body>

    <div class="col-xs-10 col-md-9 col-lg-8 form-field input_controls">
       <textarea rows="8"cols="60" id="short_description" name="short_description"></textarea>
    </div>


    <script>
    const transfer = new window.DataTransfer();
    transfer.setData('text/plain', 'I LOVE YOU');

    const element = document.querySelector('[name="short_description"]');
    element.dispatchEvent(new ClipboardEvent('paste', {
        bubbles: true,
        cancelable: true,
        clipboardData: transfer
    }));

    </script>
</body>
</html>

Unfortunately I get no text filled on the textarea above? Any idea why this does not work?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!