I have HTML file with body like this:
<body>
<div><object data="file.txt" id="data"></object></div>
</body>
This code shows the text from the file in the browser, but I'm unable to access the text from javascript. I tried '.text', '.innerHtml', '.innerText', '.textContext' and so on but I can't access it.
I need to parse the lines from the text file. Other methods of including text file into HTML which I found online didn't work at all, this is the only one that actually displays the data.
Can you advice me how to get the text to Javascript? Using plain JS please. Thank you.