Skip to content

Instantly share code, notes, and snippets.

@jayjayjpg
Created August 31, 2022 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jayjayjpg/c38218dda6a1e46ad9cef6f34e2b3940 to your computer and use it in GitHub Desktop.
Save jayjayjpg/c38218dda6a1e46ad9cef6f34e2b3940 to your computer and use it in GitHub Desktop.
test-user-interactions-in-js-apps-example8
let fileInputField = document.querySelector('#file-upload-field');
let uploadEvent = new Event('change');
let fileBlob = { files: [new Blob(['Hello World...'])] };
fileInputField.value = fileBlob.files;
fileInputField.dispatchEvent('change');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment