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

163
Visualizações
Show H1 somwhere else on the page again without typing it manually (as a kind of variable)?

I am searching for a way to display an H1 somwhere else on the page again with just HTML or JavaScript.

What I mean: I do have a H1-title which is typed in manually. And I want it automatically be displayed at the bottom on the page again, without having to type it in manually again. (The thing with the bottom on the page is just an example, my project is a bit more complex).

I'm searching kind of a variable, I think.

Thanks in advance for your help.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

 x = document.getElementById("title").innerHTML ;
document.getElementById("reap").innerHTML = x;
 <h1 id="title">Your manually written title</h1>

<h1 id="reap">Where You want to show it again</h1>

you can do this with the help of the backend or just create an id for H1 eg...

<h1 id="title">Your manually written title</h1>

<h1 id="reap">Where You want to show it again</h1>

just select with

x = document.getElementById("title").innerHTML ;
document.getElementById("reap").innerHTML = x;

Just create a variable with query selector

about 4 years ago · Juan Pablo Isaza Relatório

0

Consider you have a heading element. First you need to select the heading then create its clone using the cloneNode() function, it accepts a deep parameter which basically means the node and its whole subtree, including text that may be in child Text nodes, is also copied. After that we basically append the cloned element to the document body.

// select the heading
let el = document.querySelector('.heading');

// clone the element
let clone_el = el.cloneNode( true );


// append it to the body
document.body.append(clone_el);
<h1 class="heading">This is a heading</h1>

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