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

160
Views
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 answers
Answer question

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 Report

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