Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

101
Views
Javascript not working in HTML when running node.js

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");
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!