• Breaking News

    duplicate image

     <!DOCTYPE html>

    <html>

    <body>


    <h1>The template Element</h1>


    <p>Click the button below to display the hidden content from the template element.</p>

    <p>नीचे दिये button को जितनी बार click करेंगे उतनी बार photo  का 

    duplicate फोटो होते रहेंगे 

    <button onclick="showContent()">Show hidden content</button>


    <template>

      <h2>bird</h2>

      <img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt3VKzXbo4SN8U7EdJvAz1y6F04kcBJCD2-FvopQd9d_vJSKRf20pDNyQl842gklYCLdNP3HAMOdobJSZTRQfby6mM_MV09TQQe3GpYesUF98FIMNNjZQkJL7fqWPzUGR0COiGL25GNvGr/s2048/aarn-giri-eLC1Bd3PLu4-unsplash.jpg" width="214" height="204">

    </template>


    <script>

    function showContent() {

      var temp = document.getElementsByTagName("template")[0];

      var clon = temp.content.cloneNode(true);

      document.body.appendChild(clon);

    }

    </script>


    </body>

    </html>


    The template Element

    Click the button below to display the hidden content from the template element.

    नीचे दिये button को जितनी बार click करेंगे उतनी बार photo का duplicate फोटो होते रहेंगे

    कोई टिप्पणी नहीं

    Post Top Ad

    Post Bottom Ad