i want to access that button inside express get method but it says btn is not defined while i can use it inside JSDOM.fromFile
const jsdom = require("jsdom");
const { JSDOM } = jsdom;
JSDOM.fromFile("./index.html").then(dom => {
let btn = dom.window.document.querySelector('.btn');
}).catch(err => console.log(err));
app.listen(3000);
app.get("/", (req, res) => {
res.sendFile("./index.html", {root: __dirname})
console.log(btn)
});