Is it possible using js to import into the content block .txt file?

There index.html:
<div id="content"></div>

Is it possible in #content to sincluding the contents of the file "./resourses/data.txt"? If Yes, then how?
June 10th 19 at 15:24
2 answers
June 10th 19 at 15:26
if you are using jQuery
June 10th 19 at 15:28
fetch('/resourses/data.txt').then(function(response) {
 return response.text().then(function(text) {
 content.innerHTML = text;

Find more questions by tags Import dataJavaScript