the thing i want to do is to get the file's value like when you copy the input of the file using javascript but what if you choose a random file and get it's input using javascript?
i searched and this is what i found.
node.js file:
var http = require('http');
var fs = require('fs');
http.createServer(function (req, res) {
fs.readFile('demofile1.html', function(err, data) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.write(data);
return res.end();
});
}).listen(8080);
in demofile.html:
<html>
<body>
<h1>My Header</h1>
<p>My paragraph.</p>
</body>
</html>
but this is not what i am looking for and this is complex for me.
this iw what i mean by how to read file using js?:
{in file.html}: <075></075>
{in scripts}: {let file = file("file.html"); if (file.includes("<!doctype>"): {console.log("no errors")} else {console.log("error found"}}