I am trying to grab the text inside a div container and perform some logic based upon the text content instead of changing it. I tried to use Node.childNodes but it returns a live Nodelist instead of a copy.
Here is the DOM structure, I am trying to grab text without a container from it only.
<div class="container" > <span >text inside span</span> text without a container <button>text inside button new</button> <button>text inside button</button> </div> Any ideas?
EDIT:
Desired Output:
'text without a container' as a string
<>for create a complete snippet. can you write the desired output?