read from text file html code example
Example 1: how to load localt ext file in js
const fileUrl = '' // provide file location
fetch(fileUrl)
.then( r => r.text() )
.then( t => console.log(t) )
Example 2: html get text from file
<embed src="file.txt"> // This will show the text contained in file.txt in the page