0

I have the following page:

<h1>Paste here content!</h1>
<label for="ace">
  <div style="min-width:500px;min-height:500px;background-color:#121212;">
  </div>
</label>
<input id="ace" style="display:none" type="file" name="file">

Now I want when right-click on div to programmatically paste data to the input with id ace. Is that even possible?

In another words supposing that we copied a file from the filesystem and somewherer we have a button/link/<li> element that says Paste. How can I by clicking on it to fire a paste event to the input element? Any library is acceptable.

Durga
  • 15,263
  • 2
  • 28
  • 52
Dimitrios Desyllas
  • 9,082
  • 15
  • 74
  • 164
  • Im not good in JS but you can try these links - https://stackoverflow.com/questions/17859051/can-i-handle-a-right-click-event-on-an-html-button-element and https://stackoverflow.com/questions/2176861/javascript-get-clipboard-data-on-paste-event-cross-browser – Arun Sudhakaran Sep 13 '17 at 11:32
  • The problem in not how to handle the `click` or `paste` event. What I want is to **FIRE** a paste event manually ot a specidic div. – Dimitrios Desyllas Sep 13 '17 at 11:41

0 Answers0