I want to move some HTML code from one page to another page and don't want to retype that line of code again. How would I move it? For example:
page1.html:
<div class="container">
<img src="img/img1.jpg" alt="image">
<div class="container_para">
<p>this is image tag</p>
</div>
</div>
page2.html:
<div class="page2">
<img src="img/img2.jpg" alt="image">
</div>
How could I move all content of class container_para
to page2.html
using JavaScript?