Suppose in the text of the document index.html if such code:

<header></header> <footer></footer> 

How to implement such a thing so that this code changes to, for example, this:

 <шапка></шапка> <низ></низ> 
  • @dimkachel, If you are given an exhaustive answer, mark it as correct (click the check mark next to the selected answer). - Nicolas Chabanovsky

1 answer 1

Find the element of interest header

 el = document.getElementsByTagName("header")[0] 

Well and further from this to dance. Create a header element in its parent, find the child nodes, transfer them to the header element, delete the header .