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

164
Views
HTML & Javascript text changing

i was wondering how i could do the following:

  1. I get the input from the user using form(okay fine)
  2. i take that input and store it as a variable in javascript(got it).
  3. The variable i just saved changes the text of another page in the website (it permanently changes the text of that webpage and isn't depended on the js variable of that file anymore(it can also import the text into the web page if need be if possible)) for eg:- enter image description here

Here the user enters the details let's say the name for now

and then in the second img the text of the website changes, and when i download the second img website which doesn't hold the original js which stored the variable, it still shows the text as it might have stored the text in the file locally using js or something. [2]: https://i.stack.imgur.com/4nZCD.png

Please help me out.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

In my experience, the best way to store information from page-to-page is through local storage.

Local storage persists from page to page, while JavaScript variables are cleared out, and cookies can be un-reliable based on the response from the server they are sent too.

In your function that takes the user input, write something along the lines of:

localStorage.setItem('myCat', 'Tom');

And to retrieve this information, you can reference it like:

const cat = localStorage.getItem('myCat');

Here is a reference: https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage

about 4 years ago · Juan Pablo Isaza Report
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!