Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <!--<script src="script.js" defer></script>-->
- </head>
- <body id="body">
- <p>Lorem ipsum</p>
- <p id="output">Placeholder</p>
- <p>Lorem ipsum</p>
- <script>
- let output = "";
- let bodyContent = document.getElementById("body").innerHTML;
- output += '<div style="background-color: red">' + bodyContent + "</div>";
- output += '<div style="background-color: blue">' + bodyContent + "</div>";
- document.getElementById("output").innerHTML = output;
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement