How to move All elements in the body with adding exception for some elements to not be moved?

I think the title is clear, but I’ve some examples for you guys, here is my idea: I’ve this Html5:

Append text from html into different section

Im trying to iterate through this html and get the h4 headers and the first sentence of each section and then append it into a div. function sumary () { let headings = document.getElementsByTagName(“…