Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

how to accept pasted image in html

const form = document.getElementById("new_document_attachment");
const fileInput = document.getElementById("document_attachment_doc");

fileInput.addEventListener('change', () => {
  form.submit();
});

window.addEventListener('paste', e => {
  fileInput.files = e.clipboardData.files;
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #accept #pasted #image #html
ADD COMMENT
Topic
Name
9+1 =