blob: c04a6d3b16d8c425ff3ed5e86a509101f71cbddc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
/* eslint-env browser */
const submitBtn = document.getElementById('submit');
const fileInput = document.getElementById('file');
const fileOutput = document.getElementById('fileoutput');
fileInput.addEventListener('change', () => {
const reader = new FileReader();
reader.onload = function () {
const text = reader.result;
fileOutput.value = text;
submitBtn.disabled = false;
};
reader.readAsText(fileInput.files[0]);
});
|