Languages
[Edit]
EN

JavaScript - replace entire HTML node

7 points
Created by:
Lani-Skinner
748

In this short article, we would like to show a simple way how to replace entire <html> node using JavaScript.

Quick solution:

 

Practical example

Edit

In this solution old HTML source code is overwritten by new one.

 

Alternative solution

Edit

In this solution old HTML element is replaced by new one.

 

Alternative titles

  1. JavaScript - replace entire HTML element
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join