Skip to content

Instantly share code, notes, and snippets.

@budRich
Created December 2, 2022 15:46
Show Gist options
  • Save budRich/4ed8b58a132db9093dd43b8287b1a477 to your computer and use it in GitHub Desktop.
Save budRich/4ed8b58a132db9093dd43b8287b1a477 to your computer and use it in GitHub Desktop.
<input type="file" id="inputfile">
<br>
<pre id="output"></pre>
<script type="text/javascript">
document.getElementById('inputfile')
.addEventListener('change', function() {
var selected_file = new FileReader()
selected_file.onload = function(){
// let data = fr.result.trim().split('\n').map(x => parseInt(x))
document.getElementById('output').textContent = selected_file.result
}
selected_file.readAsText(this.files[0]);
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment