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

183
Views
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
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!