When I try to run node app.js I get no errors but none of the HTML elements work as intended. I am requiring script.js in app.js.
This is the code I am using to try and fix the issue.
This code is in srcipt.js:
require('jsdom-global')();
const fs = require('fs');
let htmlString = fs.readFileSync('index.html').toString();
document.documentElement.innerHTML = htmlString;
global.document = window.document;
let btn = global.document.getElementById("clicker");
let ageInput: any = global.document.getElementById("age");
let foodInput: any = global.document.getElementById("food");