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

192
Visualizações
How to pass input data to another input element in different html pages

I'm trying to pass the input value from index.html to be displayed on another input element in financial.html when clicking the ref link (calculate) so that the user doesn't need to input the same value twice on the financial.html page.

function handleSubmit() {
  const income = document.getElementById('income').value;
  localStorage.setItem("INCOME", income);
  return;
}

window.addEventListener('load', () => {
  const income = localStorage.getItem("INCOME");
  document.getElementById('netIncome').innerHTML = income;
})
<!--input element on index.html-->
<input type="number" name="income">
<a href="financial.html" onlick="handleSubmit()">Calculate</a>

<!--input element on financial.html-->
<input id="netIncome" type="number">

I managed to pass the value but it's not showing up in the second input box and I have to input the value again.

Any help is much appreciated. Thank you.

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