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

123
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
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