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