split an HTML file

0

I'm trying to do something, but I do not know how. Look at the code below (in html ) by clicking the "H" button a text field just below it opens. So far so good, but what I wish was that this text field, which ended up opening when I clicked on "H", was written to another file html , not everything in the same file. As if I split this html file into two other files, but I do not know how to do that while maintaining that same effect.

<!DOCTYPE html>
    <html>
    <head>

    <style type="text/css">
    .description{display:none;border-radius:10px;}
    .description:target{display:block;}
    .descriptions{margin:1.5em;}
    </style>

    </head>
    <body>

    <a href="#002_he">H</a>

        <div class="description g-nobre" id="002_he">
            <h2><a href="elemento/002_he">Hélio</a></h2>
            <p>queria que os comandos que ficassem nessa parte, fossem escritos em um arquivo diferente do arquivo que tem o botão.</p>
        </div>

    </body>
    </html>
    
asked by anonymous 13.12.2016 / 18:11

1 answer

-1

Example: index.html

    <html>
    <head>

    <style type="text/css">
    .description{display:none;border-radius:10px;}
    .description:target{display:block;}
    .descriptions{margin:1.5em;}
    </style>

    <script src="https://www.w3schools.com/lib/w3.js"></script></head><body><ahref="#002_he">H</a>

    <div class="description g-nobre" id="002_he">
        <h2><a href="elemento/002_he">Hélio</a></h2>
            <div w3-include-html="content.html"></div>
    </div>
    <script>
       w3.includeHTML();
    </script>
    </body>
    </html>

content.html

 
<h1>Códigos restantes...</h1>
<p>Mussum Ipsum, cacilds vidis litro abertis. Nec orci ornare consequat. Praesent lacinia ultrices consectetur. Sed non ipsum felis. Detraxit consequat et quo num tendi nada. Quem manda na minha terra sou euzis! Mé faiz elementum girarzis, nisi eros vermeio. Não sou faixa preta cumpadi, sou preto inteiris, inteiris. Manduma pindureta quium dia nois paga. Delegadis gente finis, bibendum egestas augue arcu ut est. Leite de capivaris, leite de mula manquis sem cabeça.</p>
<a href="https://wigny.github.io">Link</a>
 
    
31.01.2018 / 16:17