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

119
Views
How to access elements of one html in another html file using their id

I have created two html files ( file1.html and file2.html ).

In file2, I have 10 paragraphs each having a unique id . How can I access these paragraphs using their id in file1.

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

0

This can be solved with Javascript using the .getElementById method. This can be accomplished via localStorage. Below are steps to save data from file2 to the point where you're actually able to use it in file1

you can use localStorage 
for example in file2.html you save data with
var thing = document.getElementById('id').value;
localStorage.something = thing ; 
then in your file1.html you can use it by
document.getElementById("id").innerHTML=localStorage.something;
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!