I need to provide a button where users will just click and copy all the code that was used to develop that page.
I saw many similar questions, but none could solve my problem. It would be basically so, imagine that the example code below corresponds to the page that I need to copy:
<div class="conteudo-total">
<div>
<h1>Titulo</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam laboriosam inventore blanditiis repellendus corrupti, ea, maxime magnam odio, vero consequatur, dolores hic. Accusantium voluptatem nulla velit, deserunt sequi eveniet debitis.</p>
</div>
</div>
<div class="copiar">Copiar Código</div>
When I click on Copiar Código
, I need to copy all contents html
, that is, all the contents of the file. I know it would be much simpler to go into the file and copy the code directly from there, but it is an indispensable requirement that it be through a button ...