This is a follow up to this question: https://stackoverflow.com/questions/14446447/how-to-read-a-local-text-file-in-the-browser
This provided solution code works, but I need to output the result to an Element instead of the Console.
<input type="file" onchange="this.files[0].text().then(t => console.log(t))">
I've tried replacing t => console.log(t)
with document.getElementById("output").innerText = t
but that results in a Syntax Error.
What is the simplest and shortest way to implement this? Thank you.
I don't really understand arrow functions, but I looked into them and tried a variety of combinations that might work. I assume this has something to do with their syntax.