Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

141
Visualizações
Is there a way to update HTML dom everytime a node script is run

Every time a node script is run node app.js I need to update a list in the frontend, but it is not possible to manipulate DOM through node.

in HTML, I want to append children option tags to this

<body>
    <select name="endpoints" id="endpoints"></select>
  </body>

and on server side I came up with this

var endpointDropdown = document.getElementById("endpoints");

endpoints.forEach(function (item) {
  let option = document.createElement("option");
  endpointDropdown.appendChild(option);
  option.innerHTML += item;
});

Every time I run the node script, an array is generated with the required items which I want to display on the frontend. Is there anyway so when I run the script, it passes the array to the js file and then updates the html?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda