how can i move some html elements from one page to another, I thought JS would do the job if I link both of the html pages to the same Js page but I was wrong I feel It's easy to do but something is missing I can't do it I have searched here on stack overflow and google and I didn't find something that would solve the problem
here is an example:
index.html
<div id="parent1" class="container">
<h1>text</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore
<span class="icon">icon</span></p>
</div>
<a href="#" class="btn">click me</a>
I want when I click on the btn
I move what is inside #parent1
to the #parent2
that is in the input.html
page
input.html
<div id="parent2" class="con">
</div>
questions I have read and didn't solve the problem : "Cut and Paste" - moving nodes in the DOM with Javascript
How to move all HTML element children to another parent using JavaScript?
and that questions helped me a little bit but it uses the XML and Jquery and I'm not familiar with them is there any easier solution and thank you in advance