我有以下页面:
<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">
&#13;
现在我想在右键单击div时以编程方式将数据粘贴到ID为ace
的输入。这甚至可能吗?
换句话说,假设我们从文件系统和某个地方复制了一个文件,我们有一个按钮/链接/ <li>
元素,表示Paste
。如何通过单击它来将粘贴事件激发到输入元素?任何图书馆都可以接受。